easyui datagrid 행 클릭 값

2111 단어 datagrid
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);
        }
    });
}



좋은 웹페이지 즐겨찾기