Animal
12-12-2008, 05:05 AM
This would add a very useful way of measuring the width of a whole bunch of elements using DomQuery.
Calculating the max width of the composite:
Ext.override(Ext.CompositeElement, {
getTextWidth: function() {
var i, e, els = this.elements, result = 0;
for(i = 0; e = Ext.get(els[i]); i++) {
result = Math.max(result, e.getTextWidth.apply(e, arguments));
}
return result;
}
});
Calculating the max width of the composite:
Ext.override(Ext.CompositeElement, {
getTextWidth: function() {
var i, e, els = this.elements, result = 0;
for(i = 0; e = Ext.get(els[i]); i++) {
result = Math.max(result, e.getTextWidth.apply(e, arguments));
}
return result;
}
});