Hybrid View

  1. #1
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    231
    Vote Rating
    2
    nicolabaldo is on a distinguished road

      0  

    Default change button's order

    change button's order


    I use ExtJS 4.1.3
    Is it possible to insert the tool '+' before of the tool collapse??
    Thanks!
    Immagine.png

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,611
    Vote Rating
    326
    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 think collapseFirst should do what you want:

    http://docs.sencha.com/ext-js/4-1/#!...-collapseFirst

  3. #3
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    231
    Vote Rating
    2
    nicolabaldo is on a distinguished road

      0  

    Default


    Tanks for reply me.
    I tried to use collapseFirst: false, but it doesn't work!

    Code:
    Ext.define('Ext.cbaPortlet.Portlet', {
        extend: 'Ext.panel.Panel',
        alias: 'widget.portlet',
        layout: 'fit',
        anchor: '100%',
        frame: true,
        closable: false,
        collapseFirst: false,
        collapsible: true,
        animCollapse: true,
        draggable: {
            moveOnDrag: false    
        },
        cls: 'x-portlet',
    
    
        // Override Panel's default doClose to provide a custom fade out effect
        // when a portlet is removed from the portal
        doClose: function() {
            if (!this.closing) {
                this.closing = true;
                this.el.animate({
                    opacity: 0,
                    callback: function(){
                        this.fireEvent('close', this);
                        this[this.closeAction]();
                    },
                    scope: this
                });
            }
        }
    });
    Last edited by skirtle; 21 Dec 2012 at 8:32 AM. Reason: Add CODE tags

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,611
    Vote Rating
    326
    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


    Please use [CODE] tags when posting code.

    I don't see anywhere in your code that's adding a + tool.

  5. #5
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    231
    Vote Rating
    2
    nicolabaldo is on a distinguished road

      0  

    Default


    I'm sorry!! I forgot this part.

    Code:
    var x=Ext.getCmp('myPortlet').down(); //panel header
    if (!x.tools.plus){
      x.addTool({
        type:'plus',		
        handler: function(){
        myFunction();
        }
      },	
        scope:this
      });

  6. #6
    Sencha User
    Join Date
    Feb 2013
    Location
    Lawrence, KS, USA
    Posts
    25
    Vote Rating
    0
    jasewell is on a distinguished road

      0  

    Default


    Try this:
    Code:
    var x=Ext.getCmp('myPortlet').down(); //panel header
    if (!x.tools.plus){
      x.insert(0, {
        type:'plus',		
        handler: function(){
        myFunction();
        }
      },	
        scope:this
      });

Thread Participants: 2