【问题标题】:Default Value in RecordField throws JavaScript error on executeRecordField 中的默认值在执行时引发 JavaScript 错误
【发布时间】:2013-01-21 12:13:40
【问题描述】:

将以下记录字段添加到 GridPanel 存储会使网站向 Chrome 控制台抛出 JavaScript 错误
Uncaught SyntaxError: Unexpected identifier

<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)

看起来默认值没有正确引用为字符串,我该如何解决这个问题?

【问题讨论】:

    标签: javascript grid store default-value ext.net


    【解决方案1】:

    似乎记录字段的默认值通常应该是一个javascript变量。
    双引号defaultValue="'foo bar'"解决了这个问题

    【讨论】:

      猜你喜欢
      • 2020-04-26
      • 2014-07-03
      • 2013-11-25
      • 1970-01-01
      • 2016-08-14
      • 1970-01-01
      • 1970-01-01
      • 2012-08-23
      • 1970-01-01
      相关资源
      最近更新 更多