PDA

View Full Version : [FIXED] Selection Model Binding Problem When Using Multiple Grids



j-joey
21 Sep 2010, 6:29 AM
Hi,

There is a selModel binding problem when you have more than one grid in one root component. Problem occurs when first grid has no selModel specified but others has. In design time everthing seems ok. But when previewing rendering process is broken.

In the exported code selModel is defined in the right grid, but selModel is bound to first grid. If you bind a selModel to first grid too, everything works OK.

how to reproduce?
- add a panel,
- set a layout
- add 2 grids, (you can also duplicate the first one)
- set autoRefs
- bind a selModel (checkbox) to second grid
- preview

rendering is broken...

an exported code to show wrong binding:

MyPanelUi = Ext.extend(Ext.Panel, {
title: 'My Panel',
width: 919,
height: 569,
layout: 'border',
initComponent: function() {
this.items = [
{
xtype: 'grid',
title: 'My Grid',
region: 'center',
ref: 'first',
columns: [
{
xtype: 'gridcolumn',
dataIndex: 'string',
header: 'Column',
sortable: true,
width: 100
}
]
},
{
xtype: 'grid',
title: 'My Grid',
region: 'east',
width: 372,
ref: 'second',
selModel: new Ext.grid.CheckboxSelectionModel({

}),
columns: [
{
xtype: 'gridcolumn',
dataIndex: 'string',
header: 'Column',
sortable: true,
width: 100
}
]
}
];
MyPanelUi.superclass.initComponent.call(this);
this.first.colModel.config.unshift(this.first.selModel);
}
});


as you can see first grid's selModel is being bound to first colModel.

jarrednicholls
22 Sep 2010, 8:54 PM
Thanks for reporting this!

scancubus
26 Nov 2011, 2:15 PM
Hi!,

Is there a fix for this? I am having similar problem. If you create two grids from same xtype, then use checkboxselection model, it works ok with one grid, but when you switch to the tab that the second grid is in, there are now 2 columns of checkboxes...

ahmsal1984
21 Dec 2011, 3:26 PM
Hi!,

Is there a fix for this? I am having similar problem. If you create two grids from same xtype, then use checkboxselection model, it works ok with one grid, but when you switch to the tab that the second grid is in, there are now 2 columns of checkboxes...

Hi,

Did you find a solution? I am using ext js 4.0.7 and getting the same error.

Thanks

vinayakpanse
6 Jan 2012, 8:59 AM
I have three grids in one container , first time when you load the page it shows the data in first grid but to see the data in 2nd and 3rd grid I have to click 2 and 3rd tab then I can see the data, Also I noticed that only two rows get selected .

quangmd
15 May 2012, 8:06 PM
Can anybody show more clear on how to fix ? I am facing this problem too :(