【发布时间】:2014-02-08 09:37:28
【问题描述】:
我有 jqGrid 的本地数据,我为布尔列制作了自定义格式化程序。类似的东西
var boolFormatter = function (cellvalue, opt, rowObj) {
if (cellvalue == null) return "";
return (cellvalue == true)
? return "Yes"
: return "No";
}
我喜欢的模特
var colmodel = [
{index: id, name: id, hidden: true}
{index: someProperty, name: someProperty, formatter: boolFormatter}
]
问题是当我为对象调用 rowData 时,我得到字符串值,即
var rowData = grid.getRowData(1);
var value = rowData["someProperty"];
我知道这是内容值,jqGrid 有它的内部数据存储,我相信所有数据都以正常(真、假、值)格式存储。
请帮忙,我怎样才能将它们作为布尔值。提前致谢!
【问题讨论】:
标签: jquery-plugins jqgrid jqgrid-formatter