easyui获取选中行上一行的数据

时间:2023-03-08 17:46:08

text: 'XX',
            iconCls: 'icon-ok',
            handler: function () {
                var rowIndex = $(dg_datagridobject).datagrid('getRowIndex',$(dg_datagridobject).datagrid('getSelected'));
               
                if (rowIndex != 0) {
                    var rows = $(dg_datagridobject).datagrid('getRows');
                    var row = rows[rowIndex - 1];//上一行
                    alert(row.pstatus);
                }

双击某行获取值

onDblClickCell: function (rowIndex, field, value) {
var rows = $('#dataGrid').datagrid('getRows');
var row = rows[rowIndex];
var id = row.id;