I use ExtJS 4.1.3
Is it possible to insert the tool '+' before of the tool collapse??
Thanks!
Immagine.png
I use ExtJS 4.1.3
Is it possible to insert the tool '+' before of the tool collapse??
Thanks!
Immagine.png
I think collapseFirst should do what you want:
http://docs.sencha.com/ext-js/4-1/#!...-collapseFirst
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
Please use [CODE] tags when posting code.
I don't see anywhere in your code that's adding a + tool.
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 });
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 });
Great!
I hope it's not belaboring the obvious to point out that the reason collapseFirst didn't do what you needed was that the tool was being added after the panel was created.