-1
我做了一個簡單的網格(這是排序),並在其中添加了幾條記錄。當我刪除所有記錄,然後如果我點擊任何一列進行排序採取一切記錄後面,即使我刪除所有這些kendo網格排序後刪除
下面是我在做什麼
$(document).ready(function() {
var dataitem = {};
var grid = $('#mygrid').kendoGrid({
dataSource: {data : [{
status: 'On',
description: 'a longer description'
}, {
status: 'On',
description: 'a longer description'
}, {
status: 'On',
description: 'a longer description'
}, {
status: 'On',
description: 'a longer description'
}, {
status: 'On',
description: 'a longer description'
}, {
status: 'On',
description: 'a longer description'
}]},
width: 250,
height: 200,
sortable:true,
columns: [{
field: "status"
}, {
field: "description",
title: "Description"
}, {
command: [{
name: "delete",
text: "delete",
click: _handleDelete,
imageClass: "ui-icon ui-icon-close"
}],
title: " ",
width: "100"
}]
}).data('kendoGrid');
var kWindow = $('#window').kendoWindow({
width: "500px",
title: "Delete dialog",
visible: false
}).data('kendoWindow');
$('.yesbtn').click(function() {
console.log('My message');
grid.dataSource.remove(dataitem);
kWindow.close();
});
$('.nobtn').click(function() {
console.log('My other message');
dataitem = {};
kWindow.close();
});
function _handleDelete(event) {
dataitem = grid.dataItem($(event.currentTarget).closest("tr"));
kWindow.open();
};
});
在刪除數據源後調用刷新 – 2015-02-09 10:02:00
似乎對我很好:http://jsfiddle.net/KZ6pj/46/我剛剛包括可排序的屬性 – keitn 2015-02-09 10:04:31
它不起作用,刪除所有記錄然後嘗試點擊排序它會顯示所有刪除的記錄 – Ancient 2015-02-09 10:24:13