js网格添加插入模板会导致字段消失



我在jsgrid中设置了一个7字段的网格。对于其中一个字段,我需要创建一个插入模板来控制条目。不幸的是,一旦我添加代码,该字段就不再出现在表单上。前后的字段都不受影响。即使我只是创建这样的模板:

insertTemplate: function() {
return;
}

字段消失。以下是在insertTemplate:之前输入的字段参数

{   title:    "Kab Cost",
name:     "kab_cost",
type:     "text",
align:    "right", 
editing:  true,
readOnly: false,
css:      "grid_small",
validate: "required",
width:    5,
I get no javascript errors in the console. If I remove the insert template, the field appears.
I have other fields that are using insert templates with no issue.
Any ideas?

Arrghh,

为了显示字段,insertTemplate需要返回if语句中的所有返回内容(即使为空(,这些内容在网格初始化时无法解析。

将返回移到if语句之外,一切恢复正常。

用手拍打前额。

最新更新