/**
* @class Roo.bootstrap.Form
* @extends Roo.bootstrap.Component
+ * @children Roo.bootstrap.Component
* Bootstrap Form class
* @cfg {String} method GET | POST (default POST)
* @cfg {String} labelAlign top | left (default top)
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, {
* @cfg {Number} maskOffset Default 100
*/
maskOffset : 100,
+
+ /**
+ * @cfg {Boolean} maskBody
+ */
+ maskBody : false,
getAutoCreate : function(){
cls : ''
};
if (this.parent().xtype.match(/^Nav/)) {
- cfg.cls = 'navbar-form navbar-' + this.align;
+ cfg.cls = 'navbar-form form-inline navbar-' + this.align;
}
if(f.validate()){
return;
}
+
+ Roo.log('invalid field: ' + f.name);
+
valid = false;
if(!target && f.el.isVisible(true)){
// private
beforeAction : function(action){
var o = action.options;
-
+
if(this.loadMask){
- this.el.mask(o.waitMsg || "Sending", 'x-mask-loading');
+
+ if(this.maskBody){
+ Roo.get(document.body).mask(o.waitMsg || "Sending", 'x-mask-loading')
+ } else {
+ this.el.mask(o.waitMsg || "Sending", 'x-mask-loading');
+ }
}
// not really supported yet.. ??
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){
- this.el.unmask();
+// this.el.unmask();
//}else if(this.waitMsgTarget){
// this.waitMsgTarget.unmask();
//}else{
sd[field.displayField] = typeof(values[field.name]) == 'undefined' ? '' : values[field.name];
field.setFromData(sd);
+ } else if(field.setFromData && (field.store && !field.store.isLocal)) {
+
+ field.setFromData(values);
+
} else {
field.setValue(values[id]);
}
var items = this.getItems();
var ret = {};
items.each(function(f){
+
if (!f.getName()) {
return;
}
+
var v = f.getValue();
+
if (f.inputType =='radio') {
if (typeof(ret[f.getName()]) == 'undefined') {
ret[f.getName()] = ''; // empty..
v = f.el.dom.value;
}
+
+ if(f.xtype == 'MoneyField'){
+ ret[f.currencyName] = f.getCurrency();
+ }
// not sure if this supported any more..
if ((typeof(v) == 'object') && f.getRawValue) {
f.clearInvalid();
});
-
-
return this;
},
return this;
},
+
getItems : function()
{
var r=new Roo.util.MixedCollection(false, function(o){
Roo.each(el.items,function(e) {
iter(e);
});
-
-
};
iter(this);
return r;
-
-
-
-
+ },
+
+ hideFields : function(items)
+ {
+ Roo.each(items, function(i){
+
+ var f = this.findField(i);
+
+ if(!f){
+ return;
+ }
+
+ f.hide();
+
+ }, this);
+ },
+
+ showFields : function(items)
+ {
+ Roo.each(items, function(i){
+
+ var f = this.findField(i);
+
+ if(!f){
+ return;
+ }
+
+ f.show();
+
+ }, this);
}
});
var scrollable = this.target.el.findScrollableParent() || this.target.el.findParent('div.modal', 100, true) || Roo.get(document.body);
+ Roo.log(scrollable);
+
var ot = this.target.el.calcOffsetsTo(scrollable);
var scrollTo = ot[1] - this.form.maskOffset;
var tip = this.target.blankText;
if(this.target.getValue() !== '' ) {
- if (this.target.errorText.length) {
- tip = this.target.errorText;
+
+ if (this.target.invalidText.length) {
+ tip = this.target.invalidText;
} else if (this.target.regexText.length){
tip = this.target.regexText;
}