extjs - extjs4 CheckboxModel select all -


i want checkboxmodel appear checked when grid rendered:
enter image description here

this code:

sm = ext.create('ext.selection.checkboxmodel', {         listeners: {             selectionchange: function (sm, selections) {                 // must refresh view after every selection                 sm.view.refresh();             }         }     }) 

the grid:

{             xtype: 'gridpanel',             title: 'gridtitle',             selmodel: sm,             store: my_store,             columns: {                 items:[                     ..                 ]             }         } 

you use afterrender listeners of grid select rows :

 listeners:{     afterrender:function( thisobj, eopts ){         var sm=thisobj.getselectionmodel();         sm.selectall(true);     } }, 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -