PDA

View Full Version : How to update the paging after delete row?



franzisk
3 Jul 2007, 9:45 AM
I need to know how can I update the paging totalProperty (or whatever) to show the new total number after deleting a grid row.

I tryed this, no success:


var setHandleMessage = function(messageID, type){
formHandleMessage.submit({
waitMsg:'Wait, processing message',
url:'action_setMessages.php',
params:{type:type, messageID:messageID},
method:'POST',
success: function(form, action){
var selectedRow = gridSupport.getSelectionModel().getSelected();
gridSupport.dataSource.remove(selectedRow);
gridSupport.dataSource.data.totalProperty = gridSupport.dataSource.data.totalProperty - 1;
setCleanUpMessage();
},
failure: function(form, action){
alert('Message not updated');
}
});
}

violinista
4 Jul 2007, 3:55 AM
Why wouldn't you just reload the datastore? This is the simplest and the safest solution - you will get all data correct.

franzisk
4 Jul 2007, 5:00 AM
That's exactly what I did, thank you very much.

dsSupport.reload();