easyui datagride 删除选中的行

单选

var row = $('#grid_line').datagrid('getSelected');
    if (row) {
             var rowIndex = $('#grid_line').datagrid('getRowIndex', row);
             $('#grid_line').datagrid('deleteRow', rowIndex);  
     }

多选

var row = $('#grid_line').datagrid('getSelections');
    if (row) {
        for(var i=0; ivar rowIndex = $('#grid_line').datagrid('getRowIndex', row[i]);
            $('#grid_line').datagrid('deleteRow', rowIndex);  
        }
     }

你可能感兴趣的:(随记)