View Full Version : Reordering panel header tools

8 Apr 2008, 9:03 AM

I did a few searches on the forum and looked through the API but I wasn't able to find anything dealing with changing the order of the tools in the header.

Basically I have up to 4 tools in the header, a few of them are custom as well as a refresh and collapse. I want to get the collapse and refresh to appear right of the custom tools that I have, mainly I want collapse to be the right most tool just for ease of use.

I played a little trying myPanel.tools.pop() or myPanel.tools.shift(), and both of them ignored the collapse tool.

If anyone has dealt with this before or know of anything that I could try to fix it, it would be greatly appreciated.


8 Apr 2008, 10:36 AM
pop and shift remove elements from an array, if you're trying to add one you would use push (end) or unshift (beginning).

8 Apr 2008, 10:50 AM
I understand that pop and shift remove from the array, I was trying to remove the collapse tool using shift() seeing that Ext splices the collapse tool to beginning of the array. When I tried to use shift() it ignored the collapse tool and just removed my custom tool that was next to collapse.

I am looking at the code for Panels and trying to figure out how to change this either on render or after render seeing that it is the onRender function that builds the tools.

8 Apr 2008, 11:02 AM
Ah I understand, I misread your description. It sounds like you have the "standard" tools and custom tools, and you want the standard tools to appear to the right of the custom tools. Sadly, that's beyond my experience with Ext at this point.

8 Apr 2008, 11:06 AM
:) ty for your help anyways. Maybe someone else out there has some experience with this? If not, hopefully I will figure it out before the end of today (the task is due for testing tomorrow).

14 Nov 2008, 1:36 AM
Did you ever find a solution to this? I have a similar requirement and so far haven't found a way to re-order the tools.

I can see that I could use the collapseFirst:false option to push the collapse button to the right edge of the tools, but I actually want to put it in the middle of my tools, with a 'gear' button on the left, then the 'collapse' button and then a 'close' button on the right. I can't find any way to do this.

Can anyone suggest a way that this could be achieved?

Many thanks!