Hybrid View
-
23 Aug 2011 1:11 AM #1
Answered: How Can I set active tabpanel?
Answered: How Can I set active tabpanel?
Hi,
I have a tab with 3 tab and inside of each tab there is a grid list
I can delete row but ,I want to delete the row in active tab ,not if I have choose some row in another tab
How can I set active tab panel
Button code:
Code:deleteList: function (button) { var grids = button.up('relationspanel').query("gridpanel"); Ext.each(grids, function (grid) { grid.store.remove(grid.getSelectionModel().getSelection()); }); }
Tab panel code:
Code:extend: 'Ext.tab.Panel', alias: 'widget.relationspanel', width: 350, border: true, maxHeight: 280, bodyBorder: false, fieldDefaults: { labelWidth: 75, msgTarget: 'side' }, constructor: function () { this.callParent(arguments); return this; }, initComponent: function () { this.items = [{ title: 'Credential', xtype: 'container', items: [{ align: 'center', xtype: 'gridpanel', store: 'StoreAuthentications', selType: 'checkboxmodel', multiSelect: true, id: 'tab1', columns: [{ header: 'Private User ID', dataIndex: 'privUID', flex: 1, align: 'center' }, { header: 'Authentication Schema', dataIndex: 'authSchema', flex: 1, align: 'center' }, { header: 'Authentication Data', dataIndex: 'authData', flex: 1, align: 'center' }, { header: 'Public User ID', dataIndex: 'puserid', flex: 1, align: 'center' }] }] }, { title: 'PublicUID', xtype: 'container', items: [{ align: 'center', xtype: 'gridpanel', store: 'StoreActivities', selType: 'checkboxmodel', id: 'tab2', multiSelect: true, columns: [{ header: 'Public User ID', dataIndex: 'id', flex: 1, align: 'center' }, { header: 'Status', dataIndex: 'status', flex: 1, align: 'center' }, { header: 'Online Status', dataIndex: 'online', flex: 1, align: 'center' }, { header: 'Profile IDs', dataIndex: 'profileIDs', flex: 1, align: 'center' } ] }] }, { title: 'Profile', xtype: 'container', items: [{ align: 'center', xtype: 'gridpanel', store: 'StoreProfile', selType: 'checkboxmodel', id: 'tab3', multiSelect: true, columns: [{ header: 'Profile ID', dataIndex: 'id', flex: 1, align: 'center' }, { header: 'Profile Type', dataIndex: 'type', flex: 1, align: 'center' }, { header: 'Profile Data', dataIndex: 'data', flex: 1, align: 'center' }, { header: 'Private User IDs', dataIndex: 'privUIDs', flex: 1, align: 'center' }] }] }]; this.buttons = [{ text: 'Delete', icon: '../../../images/DeleteUser.png', action: 'delete', scope: this, id: 'list-delete' }]; this.callParent(arguments); } });
-
Best Answer Posted by skirtle
I'm not sure I've understood correctly. Do you mean you want to delete the selected row from the currently active tab?
Like this perhaps?
Code:deleteList: function (button) { var grid = button.up('relationspanel').getActiveTab().query("gridpanel")[0]; grid.store.remove(grid.getSelectionModel().getSelection()); }
-
23 Aug 2011 2:21 AM #2
I'm not sure I've understood correctly. Do you mean you want to delete the selected row from the currently active tab?
Like this perhaps?
Code:deleteList: function (button) { var grid = button.up('relationspanel').getActiveTab().query("gridpanel")[0]; grid.store.remove(grid.getSelectionModel().getSelection()); }
-
24 Aug 2011 5:18 AM #3Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
- Answers
- 83
have you tried myPanelRef.tab.show()?

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.
-
25 Aug 2011 1:07 AM #4
-
25 Aug 2011 1:08 AM #5
Not yet,I will try it, thanks
It worked with getActiveTab()


Reply With Quote