onClickRow: function (rowIndex, row) {
alert(row.Sales_Id);
}
完整实例:
function initgrid() {
$("#list").datagrid({
url: virthpath + 'Sales/getSalesList',
toolbar: '#tb',
title: '专场列表',
pageSize: 20,
singleSelect: true,
pageNumber: 1,
pagination: true,
fitColumns: true,
rownumbers: true,
columns: [
[
{
title: '选择', checkbox: true, field: "id"
},
{
title: "专场编号", field: "Sales_Id", width: 50, align: 'center'
},
{
title: "专场名称", field: "salesName", width: 60, align: 'center'
},
{
title: "专场状态", field: "isClose", width: 30, align: 'center'
},
{
title: "操作", field: "action", width: 60, align: 'center', formatter: function (value, rowData, index) {
// var c = '<a href="#" onclick="shopimg(' + rowData.id + ',\'' + rowData.shopname + '\',\'' + rowData.username + '\')">【店铺图片】</a> ';
var a = '<a href="#" onclick="edit(' + rowData.id + ')">【修改】</a> ';
var b = '<a href="#" onclick="del(' + rowData.id + ')">【删除】</a>';
return a + b;
}
}
]
],
onClickRow: function (rowIndex, row) {
alert(row.Sales_Id);
}
});
}