0

I am using jqgrid to show dynamic data in it, my sql stored procedure returns some data as "T & E". I am displaying this data in group header, i can only see "T" in the group header the rest of the data is trimmed down in IE 7/8. The same thing when i run it in Firefox it show correctly as "T & E". Please tell me the solution for this problem, any help would be appreciated.

I have tried the autoencode property setting it to true, but it did not work, I have kept the meta tag character encoding utf-8 in the aspx file.

4

1 回答 1

1

我在编辑时遇到了类似的问题。这个链接通过一些调整帮助我实现了我想要的。

我的系统配置。

用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 "";
        }
于 2013-02-11T12:50:47.437 回答