PDA

View Full Version : Grid with CheckboxModel and Paging.



super.rotus
26 Feb 2014, 8:51 AM
I have the following problem:
I have a grid with a selection model that works well but when i add the Paging the checkboxes doesnt work any more, is this a bug?
Regards.

scottmartin
26 Feb 2014, 10:01 AM
Do you get any errors? This should all work.

We will need more information.

super.rotus
26 Feb 2014, 2:41 PM
Do you get any errors? This should all work.

We will need more information.

Hey scott, nop i dont get any error the checkbox only isnt checkable anymore, this is my code:

I used MVC to load the grid data:

controller


if(serviceOp.value!=null){

store.load({
params: {

start:0,
limit:2000
},
callback: function(records, operation, success) {
if(records.length==0){
Ext.Msg.alert('Aviso','No se encuentran campos con esos parámetros de búsqueda');
}else{

viewgrid.getDockedComponent('toptoolbar').bindStore( store ,true);
viewgrid.getDockedComponent('toptoolbar').doRefresh( );



}


the View:


var sm = Ext.create('Ext.selection.CheckboxModel', { checkOnly: true, mode: 'MULTI' } );

{
xtype : 'grid',
itemId : 'paramReenvio',
id:'paramReenvio',
width : 700,
height : 230,
x : 5,
y : 50,
margin : '0 40 20 15',
autoScroll : true,
columnLines : true,
hideHeaders : false,
sortableColumns: false,
selModel: sm,



columns : [ ....
],
store : {type:'Reenvios'},
//store : datosServicio
dockedItems: [{
xtype: 'pagingtoolbar',
itemId: 'toptoolbar',
store : {type:'Reenvios'},
dock: 'bottom',
displayInfo: true
}]




regards

scottmartin
27 Feb 2014, 6:16 AM
store : {type:'Reenvios'},

New instance of the store?

super.rotus
27 Feb 2014, 7:29 AM
New instance of the store?

Yes, i used mvc so the store is named like that.
Regards.

scottmartin
27 Feb 2014, 7:48 AM
But since you are using 'type', you are loading a new instance of the store for grid and for paging. How about just:



Store: 'Reenvios'