PDA

View Full Version : gridPanel: grid view bindStore does not bind selection model



yyogev
22 Jul 2012, 4:00 AM
I created a multi-select list like an HTML SELECT with MULTIPLE attribute by creating a single-column grid.
On render event I do the initial selection by grid.getSelectionModel().select(recs), where recs is an array of records to select from the grid store.
This does not work as the selection model's doSelect() function checks me.store, which happens to be undefined for the selection model. As I looked at this, I saw that bindStore() for Ext.view.AbstractView does not call bindStore for its selectionModel when initial is defined.
(ExtJS 4.1.1 ext-all-debug.js line 62916)

I was only able to overcome this by setting the selection model's store to the grid store in my code.

Can anyone explain why this is so ?

Thanks,

vadimv
22 Jul 2012, 11:06 PM
post the code when the issue occurs.

yyogev
15 Aug 2012, 3:10 AM
the MultiSelect user extension which comes with the ExtJS 4.1 distribution does what I tried to do with the grid very nicely. Switching to this class solved my problem.

Thanks,