onBeforeLoad: function () {
$(this).datagrid('rejectChanges');
},
onLoadSuccess: function (data) {
// beginEdit();
},
//选中行可编辑
onClickRow: function (rowIndex, rowData) {
editingIndex = rowIndex;
if (lastIndex != rowIndex) {
if ($(this).datagrid('validateRow', lastIndex)) {
// $(this).datagrid('endEdit', lastIndex);
$(this).datagrid('beginEdit', rowIndex);
lastIndex = rowIndex;
} else {
$(this).datagrid('selectRow', lastIndex);
editingIndex = lastIndex;
}
}
}
//开始编辑
function beginEdit() {
var $dg = $("#grid");
var rows = $dg.datagrid('getRows');
for (var i = 0; i < rows.length; i++) {
$dg.datagrid('beginEdit', i);
}
}
//结束编辑
function endEdit() {
var $dg = $("#grid");
var rows = $dg.datagrid('getRows');
for (var i = 0; i < rows.length; i++) {
$dg.datagrid('endEdit', i);
}
}
//全选
function checkall() {
$("input[name=OnShip]").each(function () {
$(this).attr("checked", true);
});
}
//全消
function removeall() {
$("input[name=OnShip]").each(function () {
$(this).attr("checked", false);
});
}