2013-02-06 60 views
1

添加以下記錄字段到的GridPanel商店使得網站拋出一個JavaScript錯誤
Uncaught SyntaxError: Unexpected identifier到Chrome控制檯默認值拋出JavaScript錯誤上執行

<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的控制檯提供了以下錯誤:

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) 

它看起來好像默認值沒有正確引用爲String,我該如何解決這個問題?

回答

1

它似乎記錄字段的默認值通常應該是一個JavaScript變量。
雙引號defaultValue="'foo bar'"修復了問題