Default Value in RecordField throws JavaScript err

2019-08-12 15:57发布

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条回答
祖国的老花朵
2楼-- · 2019-08-12 16:10

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

查看更多
登录 后发表回答