編集中に同様の問題が発生しました。このリンクは、私がいくつかの調整を加えて、私が望んでいたことを達成するのに役立ちました。
私のシステム構成。
IE8で7を獲得
編集中に、「&」の後のテキストが失われました。例:「a&a」のようなテキストがあった場合、「a」のみがグリッドに表示され、最終的に保存されます。
カスタムフォーマッターは、これまで私のためにトリックを行いました。
//In col Model
//Assuming description is one of your column in the jqGrid
//Note the formatter , this is the custom formatter which does the magic for us in this case.
{ name: 'Description', index: 'Description', align: "center", sorttype: 'text', sortable: true, resizable: false, editable: editGrids, formatter: formatTextDisplay,unformat:unformatTextDisplay}
//Formatter code
var formatTextDisplay = function (cellval, opts, action) {
if (cellval) {
return $.jgrid.htmlEncode(cellval);
};
return "";
}
//Un formatter code, in case you want to read through the text in its original state from the grid for processing in the javascript file.
var unformatTextDisplay = function (cellval, opts, action) {
if (cellval) {
return $.jgrid.htmlDecode(cellval);
};
return "";
}