正文
easyui datagrid 取消删除的方法
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
下面为取消方法
。。。
{
field: 'Guid', title: '操作', width: 80, align: 'center', formatter: function (value, rowData, rowIndex) {
if (rowData) {
var $view = "<a href='javascript:void(0)' onclick='cancel(\"" + rowData.LoginId + "\")' > 取消</span>";
return $view;
}
}
}
。。。function cancel(loginId) {
var pData = $('#tb_person').datagrid('getData');
if (pData && pData.rows && pData.rows.length > 0) {
var curRow = pData.rows.find(function (m) {
return m.LoginId == loginId;
});
if (curRow) {
var curIndex = $('#tb_person').datagrid('getRowIndex', curRow);
if (curIndex > -1) {
$('#tb_person').datagrid('deleteRow', curIndex);
$('#tb_person').datagrid('reload');
}
}
}
}