PDA

View Full Version : Toolbar Multiple rows Issue



Trinad
24 Mar 2010, 9:22 AM
Hi,


In Ext 2.2 I am using the below code to create multiple rows in the EXT Toolbar.

var _table = document.createElement("TABLE");
var _tbody = document.createElement("TBODY");
var _trow = document.createElement("TR");
_table.appendChild(_tbody);
_tbody.appendChild(_trow);

$config.toolbar.add(_table);
var _tempTRow = _trow;
for(var _nugget in $config.fbar){
for(var _comp in $config.fbar[_nugget].comp){
var _temp = $config.fbar[_nugget].comp[_comp];
_temp.toolbarObject = $config.toolbar;

if(_temp.keyText=="LineBreak"){
//Create New Row
var td = document.createElement("td");
$config.toolbar.tr = document.createElement("tr");
var tbody = $config.toolbar.el.child("tbody", true);
tbody.appendChild($config.toolbar.tr);

//Create New Table for New Row
var table = document.createElement("TABLE");
var tbody = document.createElement("TBODY");
var trow = document.createElement("TR");
table.appendChild(tbody);
tbody.appendChild(trow);

$config.toolbar.add(table);

_tempTRow = trow;
}
else{
var cell1 = document.createElement("TD");
_tempTRow.appendChild(cell1);
cell1.innerHTML = _temp.keyText;

var cell2 = document.createElement("TD");
_tempTRow.appendChild(cell2);
_temp.control.render(cell2);

var cell3 = document.createElement("TD");
_tempTRow.appendChild(cell3);
cell3.innerHTML = "  ";

}
}
}
$config.toolbar.syncSize();everything works fine with above code in Ext 2.2.

Same code not working in EXT 3.1, it creates Single row & appends other items to the same row Any Idea?

Thanks,
Trinad.