【问题标题】:jqgrid group header not showing ampersand character in IE 7/8jqgrid 组标题在 IE 7/8 中未显示 & 字符
【发布时间】:2012-12-22 04:53:49
【问题描述】:
我正在使用 jqgrid 在其中显示动态数据,我的 sql 存储过程将一些数据返回为“T & E”。我在组标题中显示此数据,我只能在组标题中看到“T”,其余数据在 IE 7/8 中被修剪掉。当我在 Firefox 中运行它时,它会正确显示为“T & E”。请告诉我这个问题的解决方案,任何帮助将不胜感激。
我已经尝试将 autoencode 属性设置为 true,但它不起作用,
我在 aspx 文件中保留了元标记字符编码 utf-8。
【问题讨论】:
标签:
jqgrid
jqgrid-asp.net
【解决方案1】:
我在编辑时遇到了类似的问题。这个link 通过一些调整帮助我实现了我想要的。
我的系统配置。
用 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 "";
}