-
11 Aug 2011 1:29 PM #1
Answered: how shuild I create selModel for grid inside of tab panel
Answered: how shuild I create selModel for grid inside of tab panel
create selModel for grid inside of tab panel
I want to create selection Model for grid inside of tab panel ,but I don't know what should I do..
for grid panel I have this code and it's work :
initComponent: function() {
Ext.apply(this, { selModel: Ext.create('Ext.selection.CheckboxModel') });
this.callParent(arguments);
},
but for grid inside tab it doesn't work and I don't know How should it look like
here is some part pf my tab panel
extend: 'Ext.tab.Panel',
alias:'widget.relation',
width: 350,
border: true,
maxHeight:280,
bodyBorder: false,
fieldDefaults: {
labelWidth: 75,
msgTarget: 'side'
},
items: [{
title: 'Account',
xtype: 'container',
items:[{
align:'center',
xtype:'gridpanel',
store: 'StoreAccount',
columns: [
{header:'Method',dataIndex:'method', flex: 1,align:'center'},
{header:'Information',dataIndex:'info', flex: 1,align:'center'},
]
}]
},{
title: 'Activites',
xtype: 'container',
items:[{
align:'center',
xtype:'gridpanel',
store: 'StoreAccount',
columns: [
{header:'Method',dataIndex:'method', flex: 1,align:'center'},
{header:'Information',dataIndex:'info', flex: 1,align:'center'},
]
}]
-
Best Answer Posted by slemmon
Try adding multiSelect: true to your grid's viewconfig.
http://docs.sencha.com/ext-js/4-0/#/api/Ext.panel.Table-cfg-multiSelect
* don't forget to mark this question as answered, too.
-
11 Aug 2011 2:58 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,170
- Vote Rating
- 32
- Answers
- 83
I don't understand what you're trying to do . First, you should post code within CODE tags. Second, why not just put selType: 'cellmodel', in your grid config?

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
11 Aug 2011 3:05 PM #3
You might try in your grid configuration using the property of selType: 'checkboxmodel'.
Also, your tabPanel's items array has xtype: 'container' with an items array containing your grids, but should be able to omit the container itself and just have the grid be the item itself in your tabPanel's items array.
Also, in the future when you post code into the forum you should wrap the code in code tags using the # button in the toolbar above your post. That and indenting each block of code will make reading the code a little easier.
See if that works for you.Code:Ext.create('Ext.tab.Panel', { items: [{ xtype: 'grid' , title: 'Tab Title' , store: store , columns: columns , selType: 'checkboxmodel' }] })
-
12 Aug 2011 12:01 AM #4
It works .Thanks ,but how can I choose 2 or more row ,since I can just select one row.
-
12 Aug 2011 4:47 AM #5
Try adding multiSelect: true to your grid's viewconfig.
http://docs.sencha.com/ext-js/4-0/#/api/Ext.panel.Table-cfg-multiSelect
* don't forget to mark this question as answered, too.
-
12 Aug 2011 4:58 AM #6
Thanks but I don't know
How should I put answered ?
-
12 Aug 2011 5:03 AM #7


Reply With Quote