Login Register

best way to change grid model on the fly

Hello all, i am changing the model of a grid using the setModel method of the grid and then calling the refresh method to update data.
I have several ItemFileReadStore stores, one of them with more than 500 records, i am creating a new grid model and asigning them one of the stores and then updating the grid with the new model, that process repeats continuously depends on what store is selected in a combobox. after varius grid model changes when i set the model with the store that have 500 records, then the grid show up the first chunk of 20 rows of data after a big white space inside the grid in the place that is supose to be apear the first 20 rows instead.
Sorry for my english, but the question is: what is the best way to change grid model programmaticaly?

Thanks in advance,
Roland.

...or, in the new DataGrid of Dojo 1.2...

...what is the best way of switching store? Until recent nightly builds, I was getting good results by just calling mygrid.store.close() followed by mygrid.setStore(newstore) (with newstore already pre-built). But in Dojo 1.2b1 this leaves a bunch of white rows at the end of the grid... Is this a bug in 1.2b1, or am I following the wrong procedure?