伙计们,
我有一个由 JSONStore 支持的组合框组件。加载到存储中的数据为组合框的值返回 null。该值是一个 int。JSON解码过程是将空值转换为零;导致组合框在尝试查找 pk 时无法呈现,零在其后备存储中不存在。
我找到了 data.Field 对象的 useNull: config 选项,升级到 3.3.0 Final 并将我的组合框的 int 值设置为 useNull:true。不幸的是,这根本没有任何影响。解码后的值仍在从 null 更改为零。
当 JSON 字段的数据为空时,关于如何不将字段设置为零的任何想法?
这是正在发生的事情的照片。注意数据:值为零,但 JSON 值为空。
谢谢!
(啊!stoopid 声誉 < 10 所以我不能直接发布图片。在此处查看: 调试图片)
另外,这是我商店的字段配置:
fields: [
{name:"id", type:"int"},
{name:"occurenceDate", dateFormat: 'Y-m-d\\TH:i:s', type:"date"},
{name:"docketNumber", type:"string"},
{name:"courtLocationId", type:"int", useNull:true},
{name:"assignedOfficerId", type:"int", useNull:true},
{name:"primaryIncidentTypeId", type:"int", useNull:true},
{name:"secondaryIncidentTypeId", type:"int", useNull:true},
{name:"tertiaryIncidentTypeId", type:"int", useNull:true},
{name:"incidentLocation", type:"string"},
{name:"summary", type:"string"},
{name:"personalItemsSeized", type:"string"},
"supplements",
"parties",
"judgeIds"
]