$("#goodsList").datagrid({
url: "../Ajax/GoodsAjax.ashx",
queryParams:
{
cmd: 'getAllGd',
strWhere: strWhere,
id:i
},
fitColumns: true,
pagination: true,
rownumbers: true,
singleSelect: false,
striped: true,
checkOnSelect: true,
// onDblClickRow: clickRowGd,
pageSize: 50,
pageList: [10, 50, 100, 1000, 5000],
columns: [[
{
field: "row",
checkbox: true,
},
{
field: "g_Code",
title: "编码",
align: "center",
width: "90"
},
{
field: "g_Name",
title: "名称",
align: "center",
width: "250"
},
{
field: "g_SellPrice ",
title: "零售价",
align: "center",
width: "100"
},
{
field: "g_Memo",
title: "备注",
align: "center",
width: "250"
}
]],
});
问题:前面几个columns中‘编码’、‘名称’都正常显示,‘零售价’不显示,可是调试出的‘零售价’有值,也就是从后台获取到数据了,但为什么不显示?
解决:困扰了好久,原来是这 field出了问题,看这里: field: "g_SellPrice ", g_SellPrice后面多了一个空格