var has_flexy = (typeof(tree['flexy:if']) != 'undefined') ||
(typeof(tree['flexy:foreach']) != 'undefined');
+
-
- skip_children = false;
+ skip_children = false;
// render the element if it's not BODY.
if (!is_body) {
+
+ // if parent was disabled, then do not try and create the children..
+ if(!this[cntr](true)){
+ tree.items = [];
+ return tree;
+ }
cn = Roo.factory(tree);
//Roo.log('render');
//Roo.log(this[cntr]());
// some elements do not have render methods.. like the layouts...
+ /*
+ if(this[cntr](true) === false){
+ cn.items = [];
+ return cn;
+ }
+ */
cn.render && cn.render(this[cntr](true));
+
}
// then add the element..
}
-
-
+
// handle the kids..
var nitems = [];
this.mainBody.on('scroll', this.onBodyScroll, this);
+ this.cm.on("headerchange", this.onHeaderChange, this);
},
onBodyScroll: function()
{
//Roo.log("body scrolled');" + this.mainBody.dom.scrollLeft);
- this.mainHead.setStyle({
- 'position' : 'relative',
- 'left': (-1* this.mainBody.dom.scrollLeft) + 'px'
- });
+ if(this.mainHead){
+ this.mainHead.setStyle({
+ 'position' : 'relative',
+ 'left': (-1* this.mainBody.dom.scrollLeft) + 'px'
+ });
+ }
if(this.lazyLoad){
}
}
+ },
+
+ onHeaderChange : function()
+ {
+
+ var header = this.renderHeader();
+ var table = this.el.select('table', true).first();
+
+ this.mainHead.remove();
+ this.mainHead = table.createChild(header, this.mainBody, false);
}
+
});
this.activeAction = null;
var o = action.options;
+ if(this.loadMask){
+
+ if(this.maskBody){
+ Roo.get(document.body).unmask();
+ } else {
+ this.el.unmask();
+ }
+ }
+
//if(this.waitMsgTarget === true){
- Roo.get(document.body).unmask();
- this.el.unmask();
+// this.el.unmask();
//}else if(this.waitMsgTarget){
// this.waitMsgTarget.unmask();
//}else{
f.clearInvalid();
});
-
-
return this;
},
if(feedback){
this.el.select('.form-control-feedback', true).first().removeClass([this.invalidFeedbackClass, this.validFeedbackClass]);
}
-
+
+ if(this.indicator){
+ this.indicator.removeClass('visible');
+ this.indicator.addClass('invisible');
+ }
+
if(this.disabled){
return;
}
return;
}
- if(this.indicator){
- this.indicator.removeClass('visible');
- this.indicator.addClass('invisible');
- }
-
this.el.addClass(this.validClass);
if(this.hasFeedback && this.inputType != 'hidden' && !this.allowBlank && (this.getValue().length || this.forceFeedback)){
return;
}
- this.fieldLabel = v;
-
if(this.indicator){
var ar = this.el.select('label > span',true);
- if (!ar.elements.length) {
- Roo.log("could not find label > span on element");
- Roo.log(this);
+
+ if (ar.elements.length) {
+ this.el.select('label > span',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v);
+ this.fieldLabel = v;
return;
}
- this.el.select('label > span',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v);
+
+ var br = this.el.select('label',true);
+
+ if(br.elements.length) {
+ this.el.select('label',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v);
+ this.fieldLabel = v;
+ return;
+ }
+
+ Roo.log('Cannot Found any of label > span || label in input');
return;
}
this.el.select('label',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v);
+ this.fieldLabel = v;
+
+
}
});
onEmptyResults : function(){
if(this.tickable && this.editable){
+ this.hasFocus = false;
this.restrictHeight();
return;
}
this.disabled = false;
this.fireEvent("enable", this);
return this;
+ },
+
+ setBoxLabel : function(v)
+ {
+ this.boxLabel = v;
+
+ if(this.rendered){
+ this.el.select('label.box-label',true).first().dom.innerHTML = (v === null || v === undefined ? '' : v);
+ }
}
});
* @cfg {Boolean} castInt (true|false) cast int if true (defalut true)
*/
castInt : true,
+ /**
+ * @cfg {String} thousandsDelimiter Symbol of thousandsDelimiter
+ */
+ thousandsDelimiter : false,
+ /**
+ * @cfg {String} valueAlign alignment of value
+ */
+ valueAlign : "left",
+
+ getAutoCreate : function()
+ {
+ var hiddenInput = {
+ tag: 'input',
+ type: 'hidden',
+ id: Roo.id(),
+ cls: 'hidden-number-input'
+ };
+
+ if (this.name) {
+ hiddenInput.name = this.name;
+ }
+
+ this.name = '';
+
+ var cfg = Roo.bootstrap.NumberField.superclass.getAutoCreate.call(this);
+
+ this.name = hiddenInput.name;
+
+ if(cfg.cn.length > 0) {
+ cfg.cn.push(hiddenInput);
+ }
+
+ return cfg;
+ },
// private
initEvents : function()
allowed += "-";
}
+ if(this.thousandsDelimiter) {
+ allowed += ",";
+ }
+
this.stripCharsRe = new RegExp('[^'+allowed+']', 'gi');
var keyPress = function(e){
getValue : function()
{
- return this.fixPrecision(this.parseValue(Roo.bootstrap.NumberField.superclass.getValue.call(this)));
+ var v = this.hiddenEl().getValue();
+
+ return this.fixPrecision(this.parseValue(v));
},
parseValue : function(value)
{
+ if(this.thousandsDelimiter) {
+ value += "";
+ r = new RegExp(",", "g");
+ value = value.replace(r, "");
+ }
+
value = parseFloat(String(value).replace(this.decimalSeparator, "."));
return isNaN(value) ? '' : value;
},
fixPrecision : function(value)
{
+ if(this.thousandsDelimiter) {
+ value += "";
+ r = new RegExp(",", "g");
+ value = value.replace(r, "");
+ }
+
var nan = isNaN(value);
if(!this.allowDecimals || this.decimalPrecision == -1 || nan || !value){
setValue : function(v)
{
- v = this.fixPrecision(v);
- Roo.bootstrap.NumberField.superclass.setValue.call(this, String(v).replace(".", this.decimalSeparator));
+ v = String(this.fixPrecision(v)).replace(".", this.decimalSeparator);
+
+ this.value = v;
+
+ if(this.rendered){
+
+ this.hiddenEl().dom.value = (v === null || v === undefined ? '' : v);
+
+ this.inputEl().dom.value = Roo.util.Format.number(v, this.decimalPrecision,
+ this.thousandsDelimiter || ''
+ );
+
+ this.validate();
+ }
},
decimalPrecisionFcn : function(v)
if(v){
this.setValue(v);
}
+ },
+
+ hiddenEl : function()
+ {
+ return this.el.select('input.hidden-number-input',true).first();
}
});
}
Roo.each(this.radioes, function(i){
-
i.checked = false;
i.el.removeClass('checked');
+ });
+
+ Roo.each(this.radioes, function(i){
if(i.value === v || i.value.toString() === v.toString()){
i.checked = true;
if(suppressEvent !== true){
this.fireEvent('check', this, i);
}
+
+ return false;
}
}, this);
* @cfg {Boolean} castInt (true|false) cast int if true (defalut true)
*/
castInt : true,
+ /**
+ * @cfg {String} defaults currency of the MoneyField
+ * value should be in lkey
+ */
+ defaultCurrency : false,
+
inputlg : 9,
inputmd : 9,
this.lastSelectionText = currency;
+ //setting default currency
+ if(o[this.currencyField] * 1 == 0 && this.defaultCurrency) {
+ this.setCurrency(this.defaultCurrency);
+ return;
+ }
+
this.setCurrency(currency);
},