PDA

View Full Version : Keep rows selected in GridPanel



payo22
6 Mar 2013, 1:54 PM
Hi

I'm working with extjs 3.4, using a gridpanel with paging for show my results, each row have a checkbox for select the rows to export, but when i change of page my rows selected are lost.

how i can keep the rows selected in each page.

my grid is defined




var headers=[
{header: "Record", width: 100,renderer:renderTexto, dataIndex: "record", menuDisabled: true},
{header: "Dir", width: 150,renderer:renderDomicilio, dataIndex: "dir", menuDisabled: true}
];

grid = ext.grid.GridPanel("gridResultados",{columsHeader:headers,
loadMask: true,
maskDisabled: false,
width:670,height:280,pageSize:2,showCheckBox: 25,tbar:['->',{ text:"Delete...",
iconCls:"x-btn-remove",
tooltip:"Delet Rows Selected",
handler:deleteRegs },{ id:"boton", text:"Export", tooltip:"Export rows", hidden:cade, iconCls:"x-btn-export", handler:exportReg }]});



thanks

mitchellsimoens
8 Mar 2013, 7:23 AM
Moved to Ext JS 3 Help forum (was in Ext JS 4 Discussion forum)

willigogs
8 Mar 2013, 7:40 AM
How are you currently checking the rows?

Are you using the checkboxSelectionModel, or your own solution?

If using the checkboxSelectionModel, then you could simply add some listeners to your grid's store to find out what rows (if any) are selected on beforeload, then reselect these same rows inside your load listener.