在datagrid中添加onBeginEdit方法:
function GetSaleOrderDetailDataRecord(DJBH) {
$('#SaleOrderDetailDataList').datagrid({
//toolbar: XSDD2tb,
url: 'ashx/SaleOrderHandler.ashx?action=GetSaleOrderDetailDataRecord&DJBH='+DJBH+'',
loadMsg: '数据加载中,请稍后……',
//title: "设备维修",
striped: true, //斑马线效果
singleSelect: false, //关闭单选
checkOnSelect: true, //设置为 true,当用户点击某一行时,则会选中/取消选中复选框
selectOnCheck: true, //设置为 true,点击复选框将会选中该行
fitColumns: false, //false,表示不会出现横向滚动条;true,则表示能出现横向滚动条(列少的时候用)
rownumbers: true, //显示序号
showFooter: true, //表格页脚显示
pagination: false, //显示分页工具栏
nowrap: false, //同一行中显示数据,设置为true可以提高加载性能。
// pageSize: 20,
// pageList: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500],
columns: [[
{ field: 'XZ', width: 40, title: '选', checkbox: 'true' },
// { field: 'LSBH', width: 100, title: '序号', align: 'center' },
{ field: 'WLBH', width: 100, title: '产品代码', align: 'center' },
{ field: 'WLMC', width: 120, title: '产品名称', align: 'center',
editor: {
type: 'textbox',
options: {
icons: [{
iconCls: 'icon-more',
handler: function (e) {
ForeignDialogID.id = "Foreign_WLMC";
GetForeignDataRecord("关联语句_品名", $(e.data.target).textbox('getValue'));
$("#ForeignDialog").dialog({
title: "关联语句_品名",
width: DialogWidth * 0.5,
height: DialogHeight * 0.5
//left: (screenWidth - DialogWidth * 0.6) / 6,
//top: 120
});
$('#ForeignDialog').dialog('open');
$('#ForeignDialog').window('center');
}
}]
}
}
},
{ field: 'GGXH', width: 120, title: '产品规格', align: 'center' },
{ field: 'TH', width: 120, title: '图号', align: 'center' },
{ field: 'JLDW', width: 80, title: '计量单位', align: 'center' },
{ field: 'DDSL', width: 80, title: '计价数量', align: 'center',
editor: {
type: