1

I am using editrules custom_func for preventing user to enter same record in jQgrid. I have define custom_func on column whose colMOdel defination are as follows :

{ name: 'BO', index: 'BO', width: 40, editable: true, edittype: 'select', /*formatter: 'select',*/ editrules: { custom: true, custom_func: function (value, colName) { return CustomFunction.call(this, value, colName, oGrid); } },

I am populating select column of jQgrid as ID(UID) : Name(Text) Its Code perfectly doing his work and showing error message, but problem is error message showing UID value such as

b66a2719-b88a-427e-8904-816fe8e60fde You are creating duplicate record . Please give another role for selected BO type. and I don't want this ID value in its error message. How should I remove this value???? any suggestions???

4

1 回答 1

0

您必须将 jqGrid 更新到新版本才能解决问题。原因很简单。jqGrid 4.4.4 中使用的内联编辑模块如下几行(见这里

cv = $.jgrid.checkValues(tmp[nm],i,$t);
if(cv[0] === false) {
    cv[1] = tmp[nm] + " " + cv[1];
    return false;
}

wheretmp[nm]包含在您的情况下的文本b66a2719-b88a-427e-8904-816fe8e60fde。jqGrid 4.5.2 使用相同的代码。所以没有办法去掉前缀tmp[nm] + " "

最近发布的 4.5.4 版将这些行更改为以下内容(请参见此处)。

cv = $.jgrid.checkValues.call($t,tmp[nm],i);
if(cv[0] === false) {
    return false;
}

因此,您必须将 jqGrid 更新到 4.5.4 或在您的 jqGrid 代码副本中进行相应的更改。

于 2013-10-07T11:01:11.860 回答