Reconfiguring grid columns in ExtJs4 - SelModel disappears?

I define a grid that has selModel .
Each time the storage loads, the grid columns are dynamically reconfigured using Reconfigure grids. However, when I do this, selModel disappear.
How can I reconfigure the grid columns to enable selModel as well.
The following is sample code:

 //The Selection Model for the grid. var sm = new Ext.selection.CheckboxModel(); //The Grid var grid = new Ext.grid.Panel({ store: store, selModel: sm, columns:[{ header: 'Loading ...' }] }); //The store on load event where the columns are reconfigured store.on('load', function(store){ var columns = store.data.Data.items; grid.reconfigure(store, columns); }, this); 

In ExtJs3, I can specify selModel as the column itself, but this does not apply to ExtJs4. So, how can I guarantee that selModel is always visible even after reconfiguring the grid columns?

+2
javascript extjs extjs4
source share
2 answers

This is a bug reported in Extjs version [4.0.2]. Now it is allowed in Extjs version [4.0.7].

+2
source share

From the docs 3.3.1 API (my emphasis):

Reconfigure the grid to use different models of stores and columns and fires the "reconfigure" event. The view will be tied to new objects and updated. Remember that upon reconfiguring the GridPanel, certain existing settings may be invalid. . For example, a configured autoExpandColumn cannot last longer in the new ColumnModel. In addition, the existing PagingToolbar will still be tied to the old Store and will need to be double-checked. Any plugins may also need to be reconfigured with new data.

I believe you just need to reinstall SelectionModel after reconfiguring your grid.

0
source share

All Articles