Hybrid View

  1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    42
    Answers
    1
    Vote Rating
    0
    elnaz is on a distinguished road

      0  

    Default 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);
    }
    
    
    });

  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());
    }

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,489
    Answers
    526
    Vote Rating
    283
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    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());
    }

  4. #3
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Answers
    102
    Vote Rating
    77
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    have you tried myPanelRef.tab.show()?

  5. #4
    Sencha User
    Join Date
    Jul 2011
    Posts
    42
    Answers
    1
    Vote Rating
    0
    elnaz is on a distinguished road

      0  

    Default


    Thank you

  6. #5
    Sencha User
    Join Date
    Jul 2011
    Posts
    42
    Answers
    1
    Vote Rating
    0
    elnaz is on a distinguished road

      0  

    Default


    Not yet,I will try it, thanks

    It worked with getActiveTab()

Thread Participants: 2