Results 1 to 4 of 4

Thread: Right aligning a button in a tab bar

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    Bangalore
    Posts
    66
    Answers
    1
    Vote Rating
    0
      0  

    Default Right aligning a button in a tab bar

    I have the following code for adding a button in tab bar , which has 3 tabs
    listeners: {
    afterrender: function () {
    var bar = Ext.getCmp('artistTab').getTabBar();
    bar.insert(4, {
    xtype: 'button',
    text: 'Add New Form',
    id: 'formButton',
    handler: function () {
    // Some code
    }
    });
    }
    }

    I want this button to be at the right corner of the tab bar , how can i do it .

    Thanks

  2. #2
    Sencha User
    Join Date
    Mar 2010
    Posts
    249
    Answers
    2
    Vote Rating
    3
      0  

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    Bangalore
    Posts
    66
    Answers
    1
    Vote Rating
    0
      0  

    Default

    Thanks .

    I have alrady tried that but it is not working in tabbar , if it is toolbar it will work fine . But with tab bar i am not sure how to use .

    If i add 'tbfill' i am getting an empty tab and next to that the button appears . I want the button to be at the right corner

    one option is that i can use margins:'0 0 0 50' but i dont want to hardcode the values .

    Any suggestions ?

    Thanks.

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Location
    Bangalore
    Posts
    66
    Answers
    1
    Vote Rating
    0
      0  

    Default

    I fixed that ,. I made two insert statements as below and it is working fine

    listeners: {
    afterrender: function () {
    var bar = Ext.getCmp('artistTab').getTabBar();

    bar.insert(3,{xtype: 'tbfill'});

    bar.insert(4,{
    xtype: 'button',
    text: 'Add New Form',
    id: 'formButton',
    //margins : '0 0 0 745',
    handler: function () {
    //Some code
    }
    });
    }
    }

    Thanks .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •