-
20 Dec 2012 5:41 AM #1
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
-
20 Dec 2012 4:19 PM #2
I think collapseFirst should do what you want:
http://docs.sencha.com/ext-js/4-1/#!...-collapseFirst
-
20 Dec 2012 11:11 PM #3
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
-
21 Dec 2012 9:08 AM #4
Please use [CODE] tags when posting code.
I don't see anywhere in your code that's adding a + tool.
-
26 Dec 2012 10:48 PM #5
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 });
-
12 Feb 2013 2:17 PM #6
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 });
-
12 Feb 2013 11:07 PM #7
-
13 Feb 2013 12:02 PM #8
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.


Reply With Quote