在删除传参时,不要传索引来删除行
columns: [[ { title: '代码', field: 'Code', 100 }, { title: '名称', field: 'Name', 100 }, { title: '操作', field: 'Id', formatter: function (value, row, index) { return "<a style='cursor: pointer;margin-right:10px;' onclick='objSub.deleteLISInfoClick(" + value + ")'>删除</a>"; }, } ]] deleteLISInfoClick: function (Id) { var list = $('#grid').datagrid('getData'); for (var i = 0; i < list.rows.length; i++) { if (list.rows[i].Id == Id) { var rowIndex = $('#grid').datagrid('getRowIndex', list.rows[i]); $('#grid').datagrid('deleteRow', rowIndex); return; } } },