projects
/
roojs1
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
allow string based values for comboboxarray
[roojs1]
/
Roo
/
ContentPanel.js
diff --git
a/Roo/ContentPanel.js
b/Roo/ContentPanel.js
index
9f0146f
..
29f2a68
100644
(file)
--- a/
Roo/ContentPanel.js
+++ b/
Roo/ContentPanel.js
@@
-81,7
+81,11
@@
Roo.ContentPanel = function(el, config, content){
// xtype created footer. - not sure if will work as we normally have to render first..
if (this.footer && !this.footer.el && this.footer.xtype) {
// xtype created footer. - not sure if will work as we normally have to render first..
if (this.footer && !this.footer.el && this.footer.xtype) {
- this.toolbar.container = this.el.insertSibling(false, 'after');
+ if (!this.wrapEl) {
+ this.wrapEl = this.el.wrap();
+ }
+
+ this.footer.container = this.wrapEl.createChild();
this.footer = Roo.factory(this.footer, Roo);
this.footer = Roo.factory(this.footer, Roo);
@@
-92,6
+96,11
@@
Roo.ContentPanel = function(el, config, content){
}else{
this.resizeEl = this.el;
}
}else{
this.resizeEl = this.el;
}
+ // handle view.xtype
+
+
+
+
this.addEvents({
/**
* @event activate
this.addEvents({
/**
* @event activate
@@
-121,10
+130,13
@@
Roo.ContentPanel = function(el, config, content){
* @param {Roo.ContentPanel} this
*/
"render" : true
* @param {Roo.ContentPanel} this
*/
"render" : true
-
-
+
});
});
+
+
+
+
if(this.autoScroll){
this.resizeEl.setStyle("overflow", "auto");
} else {
if(this.autoScroll){
this.resizeEl.setStyle("overflow", "auto");
} else {
@@
-146,6
+158,13
@@
Roo.ContentPanel = function(el, config, content){
Roo.ContentPanel.superclass.constructor.call(this);
Roo.ContentPanel.superclass.constructor.call(this);
+ if (this.view && typeof(this.view.xtype) != 'undefined') {
+ this.view.el = this.el.appendChild(document.createElement("div"));
+ this.view = Roo.factory(this.view);
+ this.view.render && this.view.render(false, '');
+ }
+
+
this.fireEvent('render', this);
};
this.fireEvent('render', this);
};
@@
-273,7
+292,9
@@
panel.load({
return this.wrapEl || this.el;
},
return this.wrapEl || this.el;
},
- adjustForComponents : function(width, height){
+ adjustForComponents : function(width, height)
+ {
+ //Roo.log('adjustForComponents ');
if(this.resizeEl != this.el){
width -= this.el.getFrameWidth('lr');
height -= this.el.getFrameWidth('tb');
if(this.resizeEl != this.el){
width -= this.el.getFrameWidth('lr');
height -= this.el.getFrameWidth('tb');
@@
-283,6
+304,15
@@
panel.load({
height -= te.getHeight();
te.setWidth(width);
}
height -= te.getHeight();
te.setWidth(width);
}
+ if(this.footer){
+ var te = this.footer.getEl();
+ //Roo.log("footer:" + te.getHeight());
+
+ height -= te.getHeight();
+ te.setWidth(width);
+ }
+
+
if(this.adjustments){
width += this.adjustments[0];
height += this.adjustments[1];
if(this.adjustments){
width += this.adjustments[0];
height += this.adjustments[1];
@@
-391,22
+421,32
@@
layout.addxtype({
addxtype : function(cfg) {
// add form..
if (cfg.xtype.match(/^Form$/)) {
addxtype : function(cfg) {
// add form..
if (cfg.xtype.match(/^Form$/)) {
- var el = this.el.createChild();
+
+ var el;
+ //if (this.footer) {
+ // el = this.footer.container.insertSibling(false, 'before');
+ //} else {
+ el = this.el.createChild();
+ //}
this.form = new Roo.form.Form(cfg);
this.form = new Roo.form.Form(cfg);
- if ( this.form.allItems.length) this.form.render(el.dom);
+ if ( this.form.allItems.length) {
+ this.form.render(el.dom);
+ }
return this.form;
}
// should only have one of theses..
return this.form;
}
// should only have one of theses..
- if (['View', 'JsonView', 'DatePicker'].indexOf(cfg.xtype) > -1) {
- // views..
+ if ([ 'View', 'JsonView', 'DatePicker'].indexOf(cfg.xtype) > -1) {
+ // views.. should not be just added - used named prop 'view''
+
cfg.el = this.el.appendChild(document.createElement("div"));
// factory?
var ret = new Roo.factory(cfg);
cfg.el = this.el.appendChild(document.createElement("div"));
// factory?
var ret = new Roo.factory(cfg);
- ret.render && ret.render(false, ''); // render blank..
+
+ ret.render && ret.render(false, ''); // render blank..
this.view = ret;
return ret;
}
this.view = ret;
return ret;
}