Default Value in RecordField throws JavaScript error on execute

时光总嘲笑我的痴心妄想 提交于 2019-12-11 09:24:36

问题


Adding following Record Fields to the GridPanel Store makes the site throw a JavaScript Error
Uncaught SyntaxError: Unexpected identifier to the Chrome Console

<ext:RecordField Name="listname" AllowBlank="false" DefaultValue="Listname" />
<ext:RecordField Name="recipients" AllowBlank="false" DefaultValue="Listmembers" />
<ext:RecordField Name="usage" AllowBlank="true" />
<ext:RecordField Name="responsible" AllowBlank="false" DefaultValue="please add Responsible Person(s)/ Group(s)" />

Firebug console gives following error:

SyntaxError: missing } after property list
[Break On This Error]     
...,name:"responsible",defaultValue:please add Responsible Person(s)/ Group(s)}]}),...
---------------------------------------------|
admin.aspx (line 16, col 60)

It looks as if the Default Value is not correctly quoted as String, how can I fix this?


回答1:


It seems the default Value of a Record Field is generally supposed to be a javascript variable.
double-quoting it defaultValue="'foo bar'" fixes the problem



来源:https://stackoverflow.com/questions/14726669/default-value-in-recordfield-throws-javascript-error-on-execute

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!