项目是由mvc+easyUI开发,双击事件在下边.有注释写着呢
function DataList(supCode) {
myDatagrid2.datagridId = "GridViewTable";
myDatagrid2.title = "";
myDatagrid2.title = "供应商信息";
myDatagrid2.pagination = false;
myDatagrid2.datagridiconcls = "icon-tip";
myDatagrid2.dataUrl = "/Supplier/GetTempList/?supCode=" + supCode;
myDatagrid2.pageList = [10, 50, 100];
myDatagrid.pagesize = 10;
myDatagrid2.height = 130;
myDatagrid2.fit = false;
//myDatagrid2.fitColumns = true;//列自适应
myDatagrid2.idFiled = 'SupCCode'; //主键列的列明
// myDatagrid2.toolbar = "#toolbar";
myDatagrid2.columns = [
{ field: 'SupName', title: '供应商名称', sortable: true, align: 'center' },
{ field: 'SupCCode', title: '供应商联系人ID', sortable: true, align: 'center', hidden: 'true' },
{ field: 'SupCContact1', title: '联系人',sortable: true, align: 'center' },
{ field: 'SupCPhoneNumber1', title: '联系电话',sortable: true, align: 'center' },
{ field: 'SupCAddress', title: '地址', sortable: true, align: 'center' }
];
myDatagrid2.init();
// myDatagrid2.initToolbar();
//双击事件
$("#GridViewTable").datagrid({
onDblClickRow: function () {
var selected = $('#GridViewTable').datagrid("getSelections");
var SupCCode = selected[0].SupCCode;
//alert(SupCCode);
$.ajax({
url: "/Supplier/GetOrderDetailByChildrenInfo?SupCCode=" + SupCCode,
async: false,
success: function (data) {
if (data != null) {
$("#SupCode").val(data.SupCode);
$("#SupName").val(data.SupName);
$("#SupCCode").val(data.SupCCode); //存放最初的鱼品
$("#SupCContact1").val(data.SupCContact1);
$("#SupCPhoneNumber1").val(data.SupCPhoneNumber1); //存放最初的规格
$("#SupCProvince").val(data.SupCProvince);
$("#selCity").val(data.SupCCity);
$("#selArea").val(data.SupCArea);
$("#SupCAddress").val(data.SupCAddress);
loadData(edit_form.selProvance, edit_form.selCity, edit_form.selArea);
edit_form.selProvance.value = edit_form.SupCProvince.value;
chgProvinces(edit_form.selProvance, edit_form.selCity, edit_form.selArea);
edit_form.selCity.value = edit_form.SupCCity.value;
chgCitys(edit_form.selCity, edit_form.selArea);
edit_form.selArea.value = edit_form.SupCArea.value;
}
}
});
}
});
}