PDA

View Full Version : Custom titlebar tools button



zquirm
22 May 2007, 8:57 PM
Would it be possible to make it so we can add our own tools to the titlebar in a layout?

I'd like to have the ability to add text to the tool as well, like "See All" or "Edit", to sit beside the collapse or close button.

maybe it would just be as easy as changing createTool a bit in Ext.LayoutRegion:


createTool : function(parentEl, className, html){
if(!html) html = "& #160;"; //separated & and # b/c it showed up in the forum as just a space
var btn = Ext.DomHelper.append(parentEl, {tag: "div", cls: "x-layout-tools-button",
children: [{tag: "div", cls: "x-layout-tools-button-inner " + className, html: html}]}, true);
btn.addClassOnOver("x-layout-tools-button-over");
return btn;
}

of course, the css might need to change too.

and this may be possible already with Ext.Panel...

let me know.

jack.slocum
22 May 2007, 10:50 PM
Yes, Ext.Panel supports custom tools. It also has like 15 different built-in tools in the default tools "sprite" that you can reuse.