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);
}
+
});
Roo.bootstrap.Form = function(config){
+
Roo.bootstrap.Form.superclass.constructor.call(this, config);
Roo.bootstrap.Form.popover.apply();
*/
actioncomplete : true
});
-
};
Roo.extend(Roo.bootstrap.Form, Roo.bootstrap.Component, {
f.clearInvalid();
});
-
-
return this;
},
Roo.each(el.items,function(e) {
iter(e);
});
-
-
};
iter(this);
return r;
-
}
});
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)){
onEmptyResults : function(){
if(this.tickable && this.editable){
+ this.hasFocus = false;
this.restrictHeight();
return;
}
// private
onLoad : function(ds, r, o)
{
- this.cursor = o.params ? o.params.start : 0;
+ this.cursor = o.params.start ? o.params.start : 0;
+
var d = this.getPageData(),
ap = d.activePage,
ps = d.pages;
* @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 || ''
+ );
+
+ if(this.allowBlank && !v) {
+ this.inputEl().dom.value = '';
+ }
+
+ 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 {Number} decimalPrecision The maximum precision to display after the decimal separator (defaults to 2)
*/
- decimalPrecision : 2,
+ decimalPrecision : 0,
/**
* @cfg {Boolean} allowNegative False to prevent entering a negative sign (defaults to true)
*/
* value should be in lkey
*/
defaultCurrency : false,
+ /**
+ * @cfg {String} thousandsDelimiter Symbol of thousandsDelimiter
+ */
+ thousandsDelimiter : false,
inputlg : 9,
autocomplete: 'new-password'
};
+ var hiddenInput = {
+ tag: 'input',
+ type: 'hidden',
+ id: Roo.id(),
+ cls: 'hidden-number-input'
+ };
+
if (this.name) {
- input.name = this.name;
+ hiddenInput.name = this.name;
}
if (this.disabled) {
cfg.cn = [
label,
- container
+ container,
+ hiddenInput
];
-
+
var settings = this;
['xs','sm','md','lg'].map(function(size){
});
return cfg;
-
},
initEvents : function()
this.initCurrencyEvent();
this.initNumberEvent();
-
},
initCurrencyEvent : function()
this.value = v;
if(this.rendered){
- this.inputEl().dom.value = (v === null || v === undefined ? '' : v);
+
+ this.hiddenEl().dom.value = (v === null || v === undefined ? '' : v);
+
+ this.inputEl().dom.value = Roo.util.Format.number(v, this.decimalPrecision,
+ this.thousandsDelimiter || ','
+ );
+
+ if(this.allowBlank && !v) {
+ this.inputEl().dom.value = '';
+ }
+
this.validate();
}
},
currencyEl : function()
{
return this.el.select('.roo-money-currency-input', true).first();
+ },
+
+ hiddenEl : function()
+ {
+ return this.el.select('input.hidden-number-input',true).first();
}
});
\ No newline at end of file