}
this.beginUpdate();
// add children..
-
+ var region = '';
+ var abn = {};
Roo.each(xitems, function(i) {
- if (nb === true && !i.background) {
- nb = i;
+ region = nb && i.region ? i.region : false;
+
+ var add = ret.addxtype(i);
+
+ if (region) {
+ nb[region] = nb[region] == undefined ? 0 : nb[region]+1;
+ if (!i.background) {
+ abn[region] = nb[region] ;
+ }
}
- ret.addxtype(i);
+
});
this.endUpdate();
- if (nb && nb !== true) {
+
+ // make the last non-background panel active..
+ //if (nb) { Roo.log(abn); }
+ if (nb) {
+ for(var r in abn) {
+ region = this.getRegion(r);
+ if (region) {
+ // tried using nb[r], but it does not work..
+
+ region.showPanel(abn[r]);
+
+ }
+ }
}
return ret;