this.el.addClass('hidden');
}
- },
-
- isVisible : function(deep)
- {
- var vis = !(this.getStyle("visibility") == "hidden" || this.getStyle("display") == "none");
- if(deep !== true || !vis){
- return vis;
- }
- var p = this.dom.parentNode;
- while(p && p.tagName.toLowerCase() != "body"){
- if(!Roo.fly(p, '_isVisible').isVisible()){
- return false;
- }
- p = p.parentNode;
- }
- return true;
}
-
});
/*
{
Roo.log('img onclick');
this.fireEvent('click', this, e);
+ },
+ /**
+ * Sets the url of the image - used to update it
+ * @param {String} url the url of the image
+ */
+
+ setSrc : function(url)
+ {
+ this.src = url;
+ this.el.select('img', true).first().dom.src = url;
}
+
+
});
// BC...
- this.rowSelection = (typeof(config.RowSelection) != 'undefined') ? config.RowSelection : this.rowSelection;
- this.cellSelection = (typeof(config.CellSelection) != 'undefined') ? config.CellSelection : this.cellSelection;
+ this.rowSelection = (typeof(config.rowSelection) != 'undefined') ? config.rowSelection : this.rowSelection;
+ this.cellSelection = (typeof(config.cellSelection) != 'undefined') ? config.cellSelection : this.cellSelection;
this.headerShow = (typeof(config.thead) != 'undefined') ? config.thead : this.headerShow;
this.footerShow = (typeof(config.tfoot) != 'undefined') ? config.tfoot : this.footerShow;
if (this.footer) {
this.footer.parentId = this.id;
this.footer.onRender(this.el.select('tfoot tr td').first(), null);
- }
+ }
this.maskEl = new Roo.LoadMask(this.el, { store : this.ds, msgCls: 'roo-el-mask-msg' });
},
-
+
onDblClick : function(e,el)
{
var cell = Roo.get(el);
- if(!cell || (!this.CellSelection && !this.RowSelection)){
+ if(!cell || (!this.cellSelection && !this.rowSelection)){
return;
}
var cellIndex = cell.dom.cellIndex;
var rowIndex = this.getRowIndex(row);
- if(this.CellSelection){
+ if(this.cellSelection){
this.fireEvent('celldblclick', this, cell, rowIndex, cellIndex, e);
}
- if(this.RowSelection){
+ if(this.rowSelection){
this.fireEvent('rowdblclick', this, row, rowIndex, e);
}
},
onUpdate : function(ds,record)
{
this.refreshRow(record);
+ this.autoSize();
},
onRemove : function(ds, record, index, isUpdate){
index = ds.indexOf(record);
}
this.insertRow(ds, index, true);
+ this.autoSize();
this.onRemove(ds, record, index+1, true);
+ this.autoSize();
//this.syncRowHeights(index, index);
//this.layout();
this.fireEvent("rowupdated", this, index, record);
var thd = this.getGridEl().select('thead',true).first();
var tbd = this.getGridEl().select('tbody', true).first();
-
+ var tfd = this.getGridEl().select('tfoot', true).first();
var cw = ctr.getWidth();
if (tbd) {
- tbd.setSize(ctr.getWidth(), ctr.getHeight() - thd.getHeight());
+ tbd.setSize(ctr.getWidth(),
+ ctr.getHeight() - (thd.getHeight() + (tfd ? tfd.getHeight() : 0))
+ );
var barsize = (tbd.dom.offsetWidth - tbd.dom.clientWidth);
cw -= barsize;
}
tag: 'input',
id : id,
type : this.inputType,
- value : this.inputType == 'radio' ? this.inputValue : ((!this.checked) ? this.valueOff : this.inputValue),
+ value : this.inputValue,
cls : 'roo-' + this.inputType, //'form-box',
placeholder : this.placeholder || ''
};
+
+ var hidden = {
+ tag: 'input',
+ type : 'hidden',
+ cls : 'roo-hidden-value',
+ value : this.checked ? this.valueOff : this.inputValue
+ };
+
if (this.weight) { // Validity check?
cfg.cls += " " + this.inputType + "-" + this.weight;
}
if(this.checked){
input.checked = this.checked;
+
}
+
if (this.name) {
- input.name = this.name;
+ hidden.name = this.name;
+ input.name = '_hidden_' + this.name;
}
if (this.size) {
}
});
- var inputblock = input;
+ var inputblock = {
+ tag: 'span',
+ cn : [
+ input,
+ hidden
+ ]
+ };
if (this.before || this.after) {
}
inputblock.cn.push(input);
+ inputblock.cn.push(hidden);
if (this.after) {
inputblock.cn.push({
{
return this.el.select('input.roo-' + this.inputType,true).first();
},
+ hiddenEl: function ()
+ {
+ return this.el.select('input.hidden-value',true).first();
+ },
labelEl: function()
{
this.inputEl().dom.checked = state;
- this.inputEl().dom.value = state ? this.inputValue : this.valueOff;
+
+ this.hiddenEl().dom.value = state ? this.inputValue : this.valueOff;
if(suppressEvent !== true){
this.fireEvent('check', this, state);
return this.getGroupValue();
}
- return this.inputEl().getValue();
+ return this.hiddenEl() ? this.hiddenEl().dom.value : this.value;
},
validateRadio : function()
{
+ if(this.allowBlank){
+ return true;
+ }
+
var valid = false;
Roo.each(this.el.up('form').select('input[name='+this.name+']', true).elements, function(e){
group[i].el.findParent('.form-group', false, true).addClass(this.invalidClass);
}
+ },
+
+ disable : function()
+ {
+ if(this.inputType != 'radio'){
+ Roo.bootstrap.CheckBox.superclass.disable.call(this);
+ return;
+ }
+
+ var _this = this;
+
+ if(this.rendered){
+ Roo.each(this.el.up('form').select('input[name='+this.name+']', true).elements, function(e){
+ _this.getActionEl().addClass(this.disabledClass);
+ e.dom.disabled = true;
+ });
+ }
+
+ this.disabled = true;
+ this.fireEvent("disable", this);
+ return this;
+ },
+
+ enable : function()
+ {
+ if(this.inputType != 'radio'){
+ Roo.bootstrap.CheckBox.superclass.enable.call(this);
+ return;
+ }
+
+ var _this = this;
+
+ if(this.rendered){
+ Roo.each(this.el.up('form').select('input[name='+this.name+']', true).elements, function(e){
+ _this.getActionEl().removeClass(this.disabledClass);
+ e.dom.disabled = false;
+ });
+ }
+
+ this.disabled = false;
+ this.fireEvent("enable", this);
+ return this;
}
+
});
Roo.apply(Roo.bootstrap.CheckBox, {
w += this.config.adjustments[0];
}
}
- if(h !== null){
+ if(h !== null && h > 0){
this.el.setHeight(h);
h = this.titleEl && this.titleEl.isDisplayed() ? h - (this.titleEl.getHeight()||0) : h;
h -= this.el.getBorderWidth("tb");
initTabs : function()
{
- this.bodyEl.setStyle("overflow", "hidden");
+ //this.bodyEl.setStyle("overflow", "hidden"); -- this is set in render?
+
var ts = new Roo.bootstrap.panel.Tabs({
el: this.bodyEl.dom,
tabPosition: this.bottomTabs ? 'bottom' : 'top',
ts.maxTabWidth = this.config.maxTabWidth || 250;
ts.preferredTabWidth = this.config.preferredTabWidth || 150;
ts.monitorResize = false;
- ts.bodyEl.setStyle("overflow", this.config.autoScroll ? "auto" : "hidden");
+ //ts.bodyEl.setStyle("overflow", this.config.autoScroll ? "auto" : "hidden"); // this is set in render?
ts.bodyEl.addClass('roo-layout-tabs-body');
this.panels.each(this.initPanelAsTab, this);
},
if(!this.ignoreResize(width, height)){
var size = this.adjustForComponents(width, height);
var el = this.layout.getEl();
- el.setSize(size.width, size.height);
+ if (size.height < 1) {
+ el.setWidth(size.width);
+ } else {
+ el.setSize(size.width, size.height);
+ }
var touch = el.dom.offsetWidth;
this.layout.layout();
// ie requires a double layout on the first pass