日期:2014-05-16 浏览次数:21439 次
jQuery("#repoInDetailGrid").datagrid({以下几种测试及结果:
striped: true,
fitColumns: true,
collapsible: false,
singleSelect: true,
checkOnSelect: false,
selectOnCheck: false,
rownumbers: true,
title: "入库明细",
url: "queryProductList.do",
columns: [[{
checkbox: true,
field: "check"
}, {
title: "产品编码",
field: "productCode",
hidden: true
}, {
title: "产品名称",
field: "productName",
width: 100
}, {
title: "规格",
field: "standard",
width: 60
}, {
title: "提货价",
field: "pickPrice",
width: 80,
editor: {
type: "numberbox",
options: {
precision: 2
}
}
}, {
title: "数量",
field: "inAmount",
width: 80,
editor: "numberbox"
}]],
onLoadSuccess: function() {
for (var i = 0; i < jQuery("#repoInDetailGrid").datagrid("getRows").length; i++) {
jQuery("#repoInDetailGrid").datagrid("beginEdit", i);
}
}
});
jQuery("#repoInDetailGrid").datagrid("acceptChanges");在console下显示结果为Array[0],但是在页面上checkbox的状态依然是选中的
console.dir(jQuery("#repoInDetailGrid").datagrid("getChecked"));
jQuery("#repoInDetailGrid").datagrid("acceptChanges");然后选中表格中的几条记录,再执行
console.dir(jQuery("#repoInDetailGrid").datagrid("getChecked"));这时console下显示结果为Array[n](其中n为选中数据条数),这样就有数据了