首先,要加入idField属性
其次,idField属性必须是数据集中某一字段,且唯一。
然后,就象这样:
$(document).ready(function () { $("#tt").datagrid({ url: ‘/Control/ajax.ashx?class=DC.BusinessLogic.App.AppAction&method=GetPrint‘, rownumbers: true, pagination: true, idField:‘productid‘, height: $(document).height() - 100, width: $(document).width(), columns: [[ { field: ‘productid‘, title: ‘物料ID‘, width: 100, checkbox: true }, { field: ‘productcode‘, title: ‘物料编码‘, width: 100 }, { field: ‘productname‘, title: ‘物料名称‘, width: 200 }, { field: ‘unitname‘, title: ‘单位名称‘, width: 100 }, { field: ‘brandname‘, title: ‘品牌名称‘, width: 100 }, { field: ‘spec‘, title: ‘规格‘, width: 100 }, { field: ‘differenceno‘, title: ‘助记码‘, width: 100 }, { field: ‘scalerrate‘, title: ‘换算率‘, width: 100, hidden: true } ]] }); })
时间: 2024-11-08 11:57:53