转载来自:http://blog.csdn.net/shaobaojie/article/details/8500768
//清空原有数据
方法1:
- var item = $('#filegrid').datagrid('getRows');
- if (item) {
- for (var i = item.length - 1; i >= 0; i--) {
- var index = $('#filegrid').datagrid('getRowIndex', item[i]);
- $('#filegrid').datagrid('deleteRow', index);
- }
- }
方法2:
- $('#filegrid').datagrid('loadData', { total: 0, rows: [] });