pasinski
16 Jun 2010, 2:40 AM
Hello.
The extraCls config option does not seem to work for ToolbarLayout
{
xtype : 'panel',
layout : 'toolbar',
layoutConfig : {
extraCls : 'someClass'
},
items : [ {
xtype : 'textfield',
id : 'someId'
} ]
}
The reason for that may be that instead of using renderItem, the onLayout method of the ToolbarLayout uses simply render method for an element, thus configureItem method is never invoked:
onLayout : function(ct, target) {
//render the Toolbar HTML if it's not already present
//... some code here
var side = ct.buttonAlign == 'right' ? this.rightTr : this.leftTr,
items = ct.items.items,
position = 0;
//render each item if not already rendered, place it into the correct (left or right) target
for (var i = 0, len = items.length, c; i < len; i++, position++) {
c = items[i];
if (c.isFill) {
side = this.rightTr;
position = -1;
} else if (!c.rendered) {
c.render(this.insertCell(c, side, position));
} else {
if (!c.xtbHidden && !this.isValidParent(c, side.childNodes[position])) {
var td = this.insertCell(c, side, position);
td.appendChild(c.getPositionEl().dom);
c.container = Ext.get(td);
}
}
}
//... some code here
}
I changed it (code below), but am not sure about the impact of this change
onLayout : function(ct, target){
//... some code here
var side = this.leftTr;
var pos = 0;
var items = ct.items.items;
for(var i = 0, len = items.length, c; i < len; i++, pos++) {
c = items[i];
if(c.isFill){
side = this.rightTr;
pos = -1;
}else if(!c.rendered){
this.renderItem(c, pos, this.insertCell(c, side, pos));
// c.render(this.insertCell(c, side, pos));
}else{
if(!c.xtbHidden && !this.isValidParent(c, side.childNodes[pos])){
var td = this.insertCell(c, side, pos);
td.appendChild(c.getDomPositionEl().dom);
c.container = Ext.get(td);
}
}
}
// ... some code here
}
The extraCls config option does not seem to work for ToolbarLayout
{
xtype : 'panel',
layout : 'toolbar',
layoutConfig : {
extraCls : 'someClass'
},
items : [ {
xtype : 'textfield',
id : 'someId'
} ]
}
The reason for that may be that instead of using renderItem, the onLayout method of the ToolbarLayout uses simply render method for an element, thus configureItem method is never invoked:
onLayout : function(ct, target) {
//render the Toolbar HTML if it's not already present
//... some code here
var side = ct.buttonAlign == 'right' ? this.rightTr : this.leftTr,
items = ct.items.items,
position = 0;
//render each item if not already rendered, place it into the correct (left or right) target
for (var i = 0, len = items.length, c; i < len; i++, position++) {
c = items[i];
if (c.isFill) {
side = this.rightTr;
position = -1;
} else if (!c.rendered) {
c.render(this.insertCell(c, side, position));
} else {
if (!c.xtbHidden && !this.isValidParent(c, side.childNodes[position])) {
var td = this.insertCell(c, side, position);
td.appendChild(c.getPositionEl().dom);
c.container = Ext.get(td);
}
}
}
//... some code here
}
I changed it (code below), but am not sure about the impact of this change
onLayout : function(ct, target){
//... some code here
var side = this.leftTr;
var pos = 0;
var items = ct.items.items;
for(var i = 0, len = items.length, c; i < len; i++, pos++) {
c = items[i];
if(c.isFill){
side = this.rightTr;
pos = -1;
}else if(!c.rendered){
this.renderItem(c, pos, this.insertCell(c, side, pos));
// c.render(this.insertCell(c, side, pos));
}else{
if(!c.xtbHidden && !this.isValidParent(c, side.childNodes[pos])){
var td = this.insertCell(c, side, pos);
td.appendChild(c.getDomPositionEl().dom);
c.container = Ext.get(td);
}
}
}
// ... some code here
}