idField:'objectID', columns:[[ {field:'username',title:'username',width:200,sortable:true}, {field:'action',title:'',width:50,formatter:function(value,row,rowIndex){ var $_buttons = $("<div><a href='#' class='easyui-linkbutton' onclick='OPT_SYSTEMUSER_REMOVE(" + row.objectID + ");'></a></div>"); $_buttons.find('.easyui-linkbutton').linkbutton({plain:true,iconCls:"icon-remove"}); return $_buttons.html(); }} ]], ------------------------------------------- notice: the field 'action' ------------------------------------------- OPT_SYSTEMUSER_REMOVE = function( _objectID ){ $('#dataTabAll').datagrid('selectRecord',_objectID); var row = $('#dataTabAll').datagrid('getSelected'); var index = $('#dataTabAll').datagrid('getRowIndex',row); $('#dataTabAll').datagrid('unselectRow',index); $('#dataTabAll').datagrid('deleteRow',index); }; ------------------------------------------ Bug Desc: When I remove the last one, tip:" Uncaught TypeError: Cannot read property 'action' of undefined " And Remove successfully.
|