PDA

View Full Version : Editable Grid with checkbox[resolved]



benlargo
20 Feb 2009, 8:24 AM
Hello community,

In an Editable grid with checkbox, I've added to the toolbar a button wich check all the checkbox, with a simple loop :



for (i = 0; i < this.grid.store.totalLength; i++) {
var record = this.grid.store.getAt(i);
record.set('A', true);
}
This works as expected, but the scrollbar scrolls as the progression of changes on the grid, which contains many records.

Is it possible to block the grid's scrollbar during the changes ?

My apologies for my english, regards.

jsakalos
20 Feb 2009, 11:14 AM
Try this:


this.grid.store.suspendEvents()
for(....) {
// your loop
}
this.grid.store.resumeEvents();
this.grid.store.fireEvent('datachanged', this.grid.store);

benlargo
23 Feb 2009, 1:02 AM
This works perfectly, thank you very much. :)