roojs-ui.js
authorAlan Knowles <alan@roojs.com>
Wed, 29 Jun 2016 04:22:30 +0000 (12:22 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 29 Jun 2016 04:22:30 +0000 (12:22 +0800)
roojs-ui-debug.js
roojs-all.js
roojs-debug.js

roojs-all.js
roojs-debug.js
roojs-ui-debug.js
roojs-ui.js

index 9ef7c6a..de104a7 100644 (file)
@@ -1510,25 +1510,26 @@ Roo.menu.DateMenu=function(A){Roo.menu.DateMenu.superclass.constructor.call(this
 Roo.menu.ColorMenu=function(A){Roo.menu.ColorMenu.superclass.constructor.call(this,A);this.plain=true;var ci=new Roo.menu.ColorItem(A);this.add(ci);this.palette=ci.palette;this.relayEvents(ci,["select"]);};Roo.extend(Roo.menu.ColorMenu,Roo.menu.Menu);
 // Roo/form/Field.js
 Roo.form.Field=function(A){Roo.form.Field.superclass.constructor.call(this,A);};Roo.extend(Roo.form.Field,Roo.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"new-password"}
-,fieldClass:"x-form-field",msgTarget:'qtip',msgFx:'normal',readOnly:false,disabled:false,inputType:undefined,tabIndex:undefined,isFormField:true,hasFocus:false,value:undefined,initComponent:function(){Roo.form.Field.superclass.initComponent.call(this);this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true,keyup:true}
-);},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||'');},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);if(!this.el){var B=this.getAutoCreate();if(!B.name){B.name=typeof(this.name)=='undefined'?this.id:this.name;
-}if(!B.name.length){delete B.name;}if(this.inputType){B.type=this.inputType;}this.el=ct.createChild(B,A);}var C=this.el.dom.type;if(C){if(C=='password'){C='text';}this.el.addClass('x-form-'+C);}if(this.readOnly){this.el.dom.readOnly=true;}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);
-}this.el.addClass([this.fieldClass,this.cls]);this.initValue();},applyTo:function(A){this.allowDomMove=false;this.el=Roo.get(A);this.render(this.el.dom.parentNode);return this;},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);
-}},isDirty:function(){if(this.disabled){return false;}return String(this.getValue())!==String(this.originalValue);},afterRender:function(){Roo.form.Field.superclass.afterRender.call(this);this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);
-}},reset:function(){this.setValue(this.resetValue);this.clearInvalid();},initEvents:function(){this.el.on("keydown",this.fireKey,this);this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.el.relayEvent('keyup',this);this.originalValue=this.getValue();
-this.resetValue=this.getValue();},onFocus:function(){if(!Roo.isOpera&&this.focusClass){this.el.addClass(this.focusClass);}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();
-if(!Roo.isOpera&&this.focusClass){this.el.removeClass(this.focusClass);}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);
-}this.fireEvent("blur",this);},isValid:function(A){if(this.disabled){return true;}var B=this.preventMark;this.preventMark=A===true;var v=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=B;return v;},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();
-return true;}return false;},processValue:function(A){return A;},validateValue:function(A){return true;},markInvalid:function(A){if(!this.rendered||this.preventMark){return;}var B=(typeof(this.combo)!='undefined')?this.combo:this;B.el.addClass(this.invalidClass);
-A=A||this.invalidText;switch(this.msgTarget){case 'qtip':B.el.dom.qtip=A;B.el.dom.qclass='x-form-invalid-tip';if(Roo.QuickTips){Roo.QuickTips.enable();}break;case 'title':this.el.dom.title=A;break;case 'under':if(!this.errorEl){var C=this.el.findParent('.x-form-element',5,true);
-this.errorEl=C.createChild({cls:'x-form-invalid-msg'});this.errorEl.setWidth(C.getWidth(true)-20);}this.errorEl.update(A);Roo.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;case 'side':if(!this.errorIcon){var C=this.el.findParent('.x-form-element',5,true);
-this.errorIcon=C.createChild({cls:'x-form-invalid-icon'});}this.alignErrorIcon();this.errorIcon.dom.qtip=A;this.errorIcon.dom.qclass='x-form-invalid-tip';this.errorIcon.show();this.on('resize',this.alignErrorIcon,this);break;default:var t=Roo.getDom(this.msgTarget);
-t.innerHTML=A;t.style.display=this.msgDisplay;break;}this.fireEvent('invalid',this,A);},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,'tl-tr',[2,0]);},clearInvalid:function(){if(!this.rendered||this.preventMark){return;}var A=(typeof(this.combo)!='undefined')?this.combo:this;
-A.el.removeClass(this.invalidClass);switch(this.msgTarget){case 'qtip':A.el.dom.qtip='';break;case 'title':this.el.dom.title='';break;case 'under':if(this.errorEl){Roo.form.Field.msgFx[this.msgFx].hide(this.errorEl,this);}break;case 'side':if(this.errorIcon){this.errorIcon.dom.qtip='';
-this.errorIcon.hide();this.un('resize',this.alignErrorIcon,this);}break;default:var t=Roo.getDom(this.msgTarget);t.innerHTML='';t.style.display='none';break;}this.fireEvent('valid',this);},getRawValue:function(){var v=this.el.getValue();return v;},getValue:function(){var v=this.el.getValue();
-return v;},setRawValue:function(v){return this.el.dom.value=(v===null||v===undefined?'':v);},setValue:function(v){this.value=v;if(this.rendered){this.el.dom.value=(v===null||v===undefined?'':v);this.validate();}},adjustSize:function(w,h){var s=Roo.form.Field.superclass.adjustSize.call(this,w,h);
-s.width=this.adjustWidth(this.el.dom.tagName,s.width);return s;},adjustWidth:function(A,w){A=A.toLowerCase();if(typeof w=='number'&&Roo.isStrict&&!Roo.isSafari){if(Roo.isIE&&(A=='input'||A=='textarea')){if(A=='input'){return w+2;}if(A=='textarea'){return w-2;
-}}else if(Roo.isOpera){if(A=='input'){return w+2;}if(A=='textarea'){return w-2;}}}return w;}});Roo.form.Field.msgFx={normal:{show:function(A,f){A.setDisplayed('block');},hide:function(A,f){A.setDisplayed(false).update('');}},slide:{show:function(A,f){A.slideIn('t',{stopFx:true}
+,fieldClass:"x-form-field",msgTarget:'qtip',msgFx:'normal',readOnly:false,disabled:false,inputType:undefined,tabIndex:undefined,isFormField:true,hasFocus:false,value:undefined,loadedValue:false,initComponent:function(){Roo.form.Field.superclass.initComponent.call(this);
+this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true,keyup:true});},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||'');},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);
+if(!this.el){var B=this.getAutoCreate();if(!B.name){B.name=typeof(this.name)=='undefined'?this.id:this.name;}if(!B.name.length){delete B.name;}if(this.inputType){B.type=this.inputType;}this.el=ct.createChild(B,A);}var C=this.el.dom.type;if(C){if(C=='password'){C='text';
+}this.el.addClass('x-form-'+C);}if(this.readOnly){this.el.dom.readOnly=true;}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);}this.el.addClass([this.fieldClass,this.cls]);this.initValue();},applyTo:function(A){this.allowDomMove=false;
+this.el=Roo.get(A);this.render(this.el.dom.parentNode);return this;},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);}},isDirty:function(){if(this.disabled){return false;
+}return String(this.getValue())!==String(this.originalValue);},resetHasChanged:function(){this.loadedValue=String(this.getValue());},hasChanged:function(){if(this.disabled){return false;}return this.loadedValue!==false&&String(this.getValue())!==this.loadedValue;
+},afterRender:function(){Roo.form.Field.superclass.afterRender.call(this);this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},reset:function(){this.setValue(this.resetValue);this.clearInvalid();},initEvents:function(){this.el.on("keydown",this.fireKey,this);
+this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.el.relayEvent('keyup',this);this.originalValue=this.getValue();this.resetValue=this.getValue();},onFocus:function(){if(!Roo.isOpera&&this.focusClass){this.el.addClass(this.focusClass);
+}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){this.el.removeClass(this.focusClass);}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();
+}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);}this.fireEvent("blur",this);},isValid:function(A){if(this.disabled){return true;}var B=this.preventMark;this.preventMark=A===true;var v=this.validateValue(this.processValue(this.getRawValue()));
+this.preventMark=B;return v;},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true;}return false;},processValue:function(A){return A;},validateValue:function(A){return true;},markInvalid:function(A){if(!this.rendered||this.preventMark){return;
+}var B=(typeof(this.combo)!='undefined')?this.combo:this;B.el.addClass(this.invalidClass);A=A||this.invalidText;switch(this.msgTarget){case 'qtip':B.el.dom.qtip=A;B.el.dom.qclass='x-form-invalid-tip';if(Roo.QuickTips){Roo.QuickTips.enable();}break;case 'title':this.el.dom.title=A;
+break;case 'under':if(!this.errorEl){var C=this.el.findParent('.x-form-element',5,true);this.errorEl=C.createChild({cls:'x-form-invalid-msg'});this.errorEl.setWidth(C.getWidth(true)-20);}this.errorEl.update(A);Roo.form.Field.msgFx[this.msgFx].show(this.errorEl,this);
+break;case 'side':if(!this.errorIcon){var C=this.el.findParent('.x-form-element',5,true);this.errorIcon=C.createChild({cls:'x-form-invalid-icon'});}this.alignErrorIcon();this.errorIcon.dom.qtip=A;this.errorIcon.dom.qclass='x-form-invalid-tip';this.errorIcon.show();
+this.on('resize',this.alignErrorIcon,this);break;default:var t=Roo.getDom(this.msgTarget);t.innerHTML=A;t.style.display=this.msgDisplay;break;}this.fireEvent('invalid',this,A);},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,'tl-tr',[2,0]);},clearInvalid:function(){if(!this.rendered||this.preventMark){return;
+}var A=(typeof(this.combo)!='undefined')?this.combo:this;A.el.removeClass(this.invalidClass);switch(this.msgTarget){case 'qtip':A.el.dom.qtip='';break;case 'title':this.el.dom.title='';break;case 'under':if(this.errorEl){Roo.form.Field.msgFx[this.msgFx].hide(this.errorEl,this);
+}break;case 'side':if(this.errorIcon){this.errorIcon.dom.qtip='';this.errorIcon.hide();this.un('resize',this.alignErrorIcon,this);}break;default:var t=Roo.getDom(this.msgTarget);t.innerHTML='';t.style.display='none';break;}this.fireEvent('valid',this);},getRawValue:function(){var v=this.el.getValue();
+return v;},getValue:function(){var v=this.el.getValue();return v;},setRawValue:function(v){return this.el.dom.value=(v===null||v===undefined?'':v);},setValue:function(v){this.value=v;if(this.rendered){this.el.dom.value=(v===null||v===undefined?'':v);this.validate();
+}},adjustSize:function(w,h){var s=Roo.form.Field.superclass.adjustSize.call(this,w,h);s.width=this.adjustWidth(this.el.dom.tagName,s.width);return s;},adjustWidth:function(A,w){A=A.toLowerCase();if(typeof w=='number'&&Roo.isStrict&&!Roo.isSafari){if(Roo.isIE&&(A=='input'||A=='textarea')){if(A=='input'){return w+2;
+}if(A=='textarea'){return w-2;}}else if(Roo.isOpera){if(A=='input'){return w+2;}if(A=='textarea'){return w-2;}}}return w;}});Roo.form.Field.msgFx={normal:{show:function(A,f){A.setDisplayed('block');},hide:function(A,f){A.setDisplayed(false).update('');}},slide:{show:function(A,f){A.slideIn('t',{stopFx:true}
 );},hide:function(A,f){A.slideOut('t',{stopFx:true,useDisplay:true});}},slideRight:{show:function(A,f){A.fixDisplay();A.alignTo(f.el,'tl-tr');A.slideIn('l',{stopFx:true});},hide:function(A,f){A.slideOut('l',{stopFx:true,useDisplay:true});}}};
 // Roo/form/TextField.js
 Roo.form.TextField=function(A){Roo.form.TextField.superclass.constructor.call(this,A);this.addEvents({autosize:true});};Roo.extend(Roo.form.TextField,Roo.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,initEvents:function(){if(this.emptyText){this.el.attr('placeholder',this.emptyText);
@@ -1842,21 +1843,23 @@ if(!cn.match(/x-ed-loc-/)){return;}var n=cn.split('-').pop();var B=this.footerEl
 Roo.form.BasicForm=function(el,A){this.allItems=[];this.childForms=[];Roo.apply(this,A);this.items=new Roo.util.MixedCollection(false,function(o){return o.id||(o.id=Roo.id());});this.addEvents({beforeaction:true,actionfailed:true,actioncomplete:true});if(el){this.initEl(el);
 }Roo.form.BasicForm.superclass.constructor.call(this);};Roo.extend(Roo.form.BasicForm,Roo.util.Observable,{timeout:30,activeAction:null,trackResetOnLoad:false,childForms:false,allItems:false,waitMsgTarget:false,initEl:function(el){this.el=Roo.get(el);this.id=this.el.id||Roo.id();
 this.el.on('submit',this.onSubmit,this);this.el.addClass('x-form');},onSubmit:function(e){e.stopEvent();},isValid:function(){var A=true;this.items.each(function(f){if(!f.validate()){A=false;}});return A;},isDirty:function(){var A=false;this.items.each(function(f){if(f.isDirty()){A=true;
-return false;}});return A;},doAction:function(A,B){if(typeof A=='string'){A=new Roo.form.Action.ACTION_TYPES[A](this,B);}if(this.fireEvent('beforeaction',this,A)!==false){this.beforeAction(A);A.run.defer(100,A);}return this;},submit:function(A){this.doAction('submit',A);
-return this;},load:function(A){this.doAction('load',A);return this;},updateRecord:function(A){A.beginEdit();var fs=A.fields;fs.each(function(f){var B=this.findField(f.name);if(B){A.set(f.name,B.getValue());}},this);A.endEdit();return this;},loadRecord:function(A){this.setValues(A.data);
-return this;},beforeAction:function(A){var o=A.options;if(this.waitMsgTarget===true){this.el.mask(o.waitMsg||"Sending",'x-mask-loading');}else if(this.waitMsgTarget){this.waitMsgTarget=Roo.get(this.waitMsgTarget);this.waitMsgTarget.mask(o.waitMsg||"Sending",'x-mask-loading');
-}else{Roo.MessageBox.wait(o.waitMsg||"Sending",o.waitTitle||this.waitTitle||'Please Wait...');}},afterAction:function(A,B){this.activeAction=null;var o=A.options;if(this.waitMsgTarget===true){this.el.unmask();}else if(this.waitMsgTarget){this.waitMsgTarget.unmask();
-}else{Roo.MessageBox.updateProgress(1);Roo.MessageBox.hide();}if(B){if(o.reset){this.reset();}Roo.callback(o.success,o.scope,[this,A]);this.fireEvent('actioncomplete',this,A);}else{if((typeof(A.result)!='undefined')&&(typeof(A.result.errors)!='undefined')&&(typeof(A.result.errors.needs_confirm)!='undefined')){var _t=this;
-Roo.MessageBox.confirm("Change requires confirmation",A.result.errorMsg,function(r){if(r!='yes'){return;}_t.doAction('submit',{params:{_submit_confirmed:1}});});return;}Roo.callback(o.failure,o.scope,[this,A]);if(!this.hasListener('actionfailed')){Roo.MessageBox.alert("Error",(typeof(A.result)!='undefined'&&typeof(A.result.errorMsg)!='undefined')?A.result.errorMsg:"Saving Failed, please check your entries or try again");
+return false;}});return A;},hasChanged:function(){var A=false;this.items.each(function(f){if(f.hasChanged()){A=true;return false;}});return A;},resetHasChanged:function(){this.items.each(function(f){f.resetHasChanged();});},doAction:function(A,B){if(typeof A=='string'){A=new Roo.form.Action.ACTION_TYPES[A](this,B);
+}if(this.fireEvent('beforeaction',this,A)!==false){this.beforeAction(A);A.run.defer(100,A);}return this;},submit:function(A){this.doAction('submit',A);return this;},load:function(A){this.doAction('load',A);return this;},updateRecord:function(A){A.beginEdit();
+var fs=A.fields;fs.each(function(f){var B=this.findField(f.name);if(B){A.set(f.name,B.getValue());}},this);A.endEdit();return this;},loadRecord:function(A){this.setValues(A.data);return this;},beforeAction:function(A){var o=A.options;if(this.waitMsgTarget===true){this.el.mask(o.waitMsg||"Sending",'x-mask-loading');
+}else if(this.waitMsgTarget){this.waitMsgTarget=Roo.get(this.waitMsgTarget);this.waitMsgTarget.mask(o.waitMsg||"Sending",'x-mask-loading');}else{Roo.MessageBox.wait(o.waitMsg||"Sending",o.waitTitle||this.waitTitle||'Please Wait...');}},afterAction:function(A,B){this.activeAction=null;
+var o=A.options;if(this.waitMsgTarget===true){this.el.unmask();}else if(this.waitMsgTarget){this.waitMsgTarget.unmask();}else{Roo.MessageBox.updateProgress(1);Roo.MessageBox.hide();}if(B){if(o.reset){this.reset();}Roo.callback(o.success,o.scope,[this,A]);
+this.fireEvent('actioncomplete',this,A);}else{if((typeof(A.result)!='undefined')&&(typeof(A.result.errors)!='undefined')&&(typeof(A.result.errors.needs_confirm)!='undefined')){var _t=this;Roo.MessageBox.confirm("Change requires confirmation",A.result.errorMsg,function(r){if(r!='yes'){return;
+}_t.doAction('submit',{params:{_submit_confirmed:1}});});return;}Roo.callback(o.failure,o.scope,[this,A]);if(!this.hasListener('actionfailed')){Roo.MessageBox.alert("Error",(typeof(A.result)!='undefined'&&typeof(A.result.errorMsg)!='undefined')?A.result.errorMsg:"Saving Failed, please check your entries or try again");
 }this.fireEvent('actionfailed',this,A);}},findField:function(id){var A=this.items.get(id);if(!A){this.items.each(function(f){if(f.isFormField&&(f.dataIndex==id||f.id==id||f.getName()==id)){A=f;return false;}});}return A||null;},addForm:function(A){if(this.childForms.indexOf(A)>-1){return;
 }this.childForms.push(A);var n='';Roo.each(A.allItems,function(fe){n=typeof(fe.getName)=='undefined'?fe.name:fe.getName();if(this.findField(n)){return;}var B=new Roo.form.Hidden({name:n});B.render(this.el);this.add(B);},this);},markInvalid:function(A){if(A instanceof Array){for(var i=0,B=A.length;
 i<B;i++){var C=A[i];var f=this.findField(C.id);if(f){f.markInvalid(C.msg);}}}else{var D,id;for(id in A){if(typeof A[id]!='function'&&(D=this.findField(id))){D.markInvalid(A[id]);}}}Roo.each(this.childForms||[],function(f){f.markInvalid(A);});return this;}
 ,setValues:function(A){if(A instanceof Array){for(var i=0,B=A.length;i<B;i++){var v=A[i];var f=this.findField(v.id);if(f){f.setValue(v.value);if(this.trackResetOnLoad){f.originalValue=f.getValue();}}}}else{var C,id;for(id in A){if(typeof A[id]!='function'&&(C=this.findField(id))){if(C.setFromData&&C.valueField&&C.displayField&&(C.store&&!C.store.isLocal)){var sd={}
-;sd[C.valueField]=typeof(A[C.hiddenName])=='undefined'?'':A[C.hiddenName];sd[C.displayField]=typeof(A[C.name])=='undefined'?'':A[C.name];C.setFromData(sd);}else{C.setValue(A[id]);}if(this.trackResetOnLoad){C.originalValue=C.getValue();}}}}Roo.each(this.childForms||[],function(f){f.setValues(A);
-});return this;},getValues:function(A){if(this.childForms){Roo.each(this.childForms,function(f){this.setValues(f.getValues());},this);}var fs=Roo.lib.Ajax.serializeForm(this.el.dom);if(A===true){return fs;}return Roo.urlDecode(fs);},getFieldValues:function(A){if(this.childForms){Roo.each(this.childForms,function(f){this.setValues(f.getValues());
-},this);}var B={};this.items.each(function(f){if(!f.getName()){return;}var v=f.getValue();if(f.inputType=='radio'){if(typeof(B[f.getName()])=='undefined'){B[f.getName()]='';}if(!f.el.dom.checked){return;}v=f.el.dom.value;}if((typeof(v)=='object')&&f.getRawValue){v=f.getRawValue();
-}if(f.name!=f.getName()){B[f.name]=f.getRawValue();}B[f.getName()]=v;});return B;},clearInvalid:function(){this.items.each(function(f){f.clearInvalid();});Roo.each(this.childForms||[],function(f){f.clearInvalid();});return this;},reset:function(){this.items.each(function(f){f.reset();
-});Roo.each(this.childForms||[],function(f){f.reset();});return this;},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this;},remove:function(A){this.items.remove(A);return this;},render:function(){this.items.each(function(f){if(f.isFormField&&!f.rendered&&document.getElementById(f.id)){f.applyTo(f.id);
+;sd[C.valueField]=typeof(A[C.hiddenName])=='undefined'?'':A[C.hiddenName];sd[C.displayField]=typeof(A[C.name])=='undefined'?'':A[C.name];C.setFromData(sd);}else{C.setValue(A[id]);}if(this.trackResetOnLoad){C.originalValue=C.getValue();}}}}this.resetHasChanged();
+Roo.each(this.childForms||[],function(f){f.setValues(A);f.resetHasChanged();});return this;},getValues:function(A){if(this.childForms){Roo.each(this.childForms,function(f){this.setValues(f.getValues());},this);}var fs=Roo.lib.Ajax.serializeForm(this.el.dom);
+if(A===true){return fs;}return Roo.urlDecode(fs);},getFieldValues:function(A){if(this.childForms){Roo.each(this.childForms,function(f){this.setValues(f.getValues());},this);}var B={};this.items.each(function(f){if(!f.getName()){return;}var v=f.getValue();
+if(f.inputType=='radio'){if(typeof(B[f.getName()])=='undefined'){B[f.getName()]='';}if(!f.el.dom.checked){return;}v=f.el.dom.value;}if((typeof(v)=='object')&&f.getRawValue){v=f.getRawValue();}if(f.name!=f.getName()){B[f.name]=f.getRawValue();}B[f.getName()]=v;
+});return B;},clearInvalid:function(){this.items.each(function(f){f.clearInvalid();});Roo.each(this.childForms||[],function(f){f.clearInvalid();});return this;},reset:function(){this.items.each(function(f){f.reset();});Roo.each(this.childForms||[],function(f){f.reset();
+});return this;},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this;},remove:function(A){this.items.remove(A);return this;},render:function(){this.items.each(function(f){if(f.isFormField&&!f.rendered&&document.getElementById(f.id)){f.applyTo(f.id);
 }});return this;},applyToFields:function(o){this.items.each(function(f){Roo.apply(f,o);});return this;},applyIfToFields:function(o){this.items.each(function(f){Roo.applyIf(f,o);});return this;}});Roo.BasicForm=Roo.form.BasicForm;
 // Roo/form/Form.js
 Roo.form.Form=function(A){var B=[];if(A.items){B=A.items;delete A.items;}Roo.form.Form.superclass.constructor.call(this,null,A);this.url=this.url||this.action;if(!this.root){this.root=new Roo.form.Layout(Roo.applyIf({id:Roo.id()},A));}this.active=this.root;
index e38025c..51bfa38 100644 (file)
@@ -37191,7 +37191,10 @@ side          Add an error icon to the right of the field with a popup on hover
     /**
      * @cfg {String} cls A CSS class to apply to the field's underlying element.
      */
-
+    // private
+    loadedValue : false,
+     
+     
        // private ??
        initComponent : function(){
         Roo.form.Field.superclass.initComponent.call(this);
@@ -37312,6 +37315,7 @@ side          Add an error icon to the right of the field with a popup on hover
 
     /**
      * Returns true if this field has been changed since it was originally loaded and is not disabled.
+     * DEPRICATED  - it never worked well - use hasChanged/resetHasChanged.
      */
     isDirty : function() {
         if(this.disabled) {
@@ -37320,6 +37324,27 @@ side          Add an error icon to the right of the field with a popup on hover
         return String(this.getValue()) !== String(this.originalValue);
     },
 
+    /**
+     * stores the current value in loadedValue
+     */
+    resetHasChanged : function()
+    {
+        this.loadedValue = String(this.getValue());
+    },
+    /**
+     * checks the current value against the 'loaded' value.
+     * Note - will return false if 'resetHasChanged' has not been called first.
+     */
+    hasChanged : function()
+    {
+        if(this.disabled) {
+            return false;
+        }
+        return this.loadedValue !== false && String(this.getValue()) !== this.loadedValue;
+    },
+    
+    
+    
     // private
     afterRender : function(){
         Roo.form.Field.superclass.afterRender.call(this);
@@ -45161,7 +45186,7 @@ Roo.extend(Roo.form.BasicForm, Roo.util.Observable, {
     },
 
     /**
-     * Returns true if any fields in this form have changed since their original load.
+     * DEPRICATED Returns true if any fields in this form have changed since their original load. 
      * @return Boolean
      */
     isDirty : function(){
@@ -45174,7 +45199,39 @@ Roo.extend(Roo.form.BasicForm, Roo.util.Observable, {
         });
         return dirty;
     },
-
+    
+    /**
+     * Returns true if any fields in this form have changed since their original load. (New version)
+     * @return Boolean
+     */
+    
+    hasChanged : function()
+    {
+        var dirty = false;
+        this.items.each(function(f){
+           if(f.hasChanged()){
+               dirty = true;
+               return false;
+           }
+        });
+        return dirty;
+        
+    },
+    /**
+     * Resets all hasChanged to 'false' -
+     * The old 'isDirty' used 'original value..' however this breaks reset() and a few other things.
+     * So hasChanged storage is only to be used for this purpose
+     * @return Boolean
+     */
+    resetHasChanged : function()
+    {
+        this.items.each(function(f){
+           f.resetHasChanged();
+        });
+        
+    },
+    
+    
     /**
      * Performs a predefined action (submit or load) or custom actions you define on this form.
      * @param {String} actionName The name of the action type
@@ -45458,9 +45515,12 @@ clientValidation  Boolean          Applies to submit only.  Pass true to call fo
                 }
             }
         }
-         
+        this.resetHasChanged();
+        
+        
         Roo.each(this.childForms || [], function (f) {
             f.setValues(values);
+            f.resetHasChanged();
         });
                 
         return this;
index 2862a6b..31e2a84 100644 (file)
@@ -20718,7 +20718,10 @@ side          Add an error icon to the right of the field with a popup on hover
     /**
      * @cfg {String} cls A CSS class to apply to the field's underlying element.
      */
-
+    // private
+    loadedValue : false,
+     
+     
        // private ??
        initComponent : function(){
         Roo.form.Field.superclass.initComponent.call(this);
@@ -20839,6 +20842,7 @@ side          Add an error icon to the right of the field with a popup on hover
 
     /**
      * Returns true if this field has been changed since it was originally loaded and is not disabled.
+     * DEPRICATED  - it never worked well - use hasChanged/resetHasChanged.
      */
     isDirty : function() {
         if(this.disabled) {
@@ -20847,6 +20851,27 @@ side          Add an error icon to the right of the field with a popup on hover
         return String(this.getValue()) !== String(this.originalValue);
     },
 
+    /**
+     * stores the current value in loadedValue
+     */
+    resetHasChanged : function()
+    {
+        this.loadedValue = String(this.getValue());
+    },
+    /**
+     * checks the current value against the 'loaded' value.
+     * Note - will return false if 'resetHasChanged' has not been called first.
+     */
+    hasChanged : function()
+    {
+        if(this.disabled) {
+            return false;
+        }
+        return this.loadedValue !== false && String(this.getValue()) !== this.loadedValue;
+    },
+    
+    
+    
     // private
     afterRender : function(){
         Roo.form.Field.superclass.afterRender.call(this);
@@ -28688,7 +28713,7 @@ Roo.extend(Roo.form.BasicForm, Roo.util.Observable, {
     },
 
     /**
-     * Returns true if any fields in this form have changed since their original load.
+     * DEPRICATED Returns true if any fields in this form have changed since their original load. 
      * @return Boolean
      */
     isDirty : function(){
@@ -28701,7 +28726,39 @@ Roo.extend(Roo.form.BasicForm, Roo.util.Observable, {
         });
         return dirty;
     },
-
+    
+    /**
+     * Returns true if any fields in this form have changed since their original load. (New version)
+     * @return Boolean
+     */
+    
+    hasChanged : function()
+    {
+        var dirty = false;
+        this.items.each(function(f){
+           if(f.hasChanged()){
+               dirty = true;
+               return false;
+           }
+        });
+        return dirty;
+        
+    },
+    /**
+     * Resets all hasChanged to 'false' -
+     * The old 'isDirty' used 'original value..' however this breaks reset() and a few other things.
+     * So hasChanged storage is only to be used for this purpose
+     * @return Boolean
+     */
+    resetHasChanged : function()
+    {
+        this.items.each(function(f){
+           f.resetHasChanged();
+        });
+        
+    },
+    
+    
     /**
      * Performs a predefined action (submit or load) or custom actions you define on this form.
      * @param {String} actionName The name of the action type
@@ -28985,9 +29042,12 @@ clientValidation  Boolean          Applies to submit only.  Pass true to call fo
                 }
             }
         }
-         
+        this.resetHasChanged();
+        
+        
         Roo.each(this.childForms || [], function (f) {
             f.setValues(values);
+            f.resetHasChanged();
         });
                 
         return this;
index e02d2e6..f564f1c 100644 (file)
@@ -840,25 +840,26 @@ Roo.menu.DateMenu=function(A){Roo.menu.DateMenu.superclass.constructor.call(this
 Roo.menu.ColorMenu=function(A){Roo.menu.ColorMenu.superclass.constructor.call(this,A);this.plain=true;var ci=new Roo.menu.ColorItem(A);this.add(ci);this.palette=ci.palette;this.relayEvents(ci,["select"]);};Roo.extend(Roo.menu.ColorMenu,Roo.menu.Menu);
 // Roo/form/Field.js
 Roo.form.Field=function(A){Roo.form.Field.superclass.constructor.call(this,A);};Roo.extend(Roo.form.Field,Roo.BoxComponent,{invalidClass:"x-form-invalid",invalidText:"The value in this field is invalid",focusClass:"x-form-focus",validationEvent:"keyup",validateOnBlur:true,validationDelay:250,defaultAutoCreate:{tag:"input",type:"text",size:"20",autocomplete:"new-password"}
-,fieldClass:"x-form-field",msgTarget:'qtip',msgFx:'normal',readOnly:false,disabled:false,inputType:undefined,tabIndex:undefined,isFormField:true,hasFocus:false,value:undefined,initComponent:function(){Roo.form.Field.superclass.initComponent.call(this);this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true,keyup:true}
-);},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||'');},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);if(!this.el){var B=this.getAutoCreate();if(!B.name){B.name=typeof(this.name)=='undefined'?this.id:this.name;
-}if(!B.name.length){delete B.name;}if(this.inputType){B.type=this.inputType;}this.el=ct.createChild(B,A);}var C=this.el.dom.type;if(C){if(C=='password'){C='text';}this.el.addClass('x-form-'+C);}if(this.readOnly){this.el.dom.readOnly=true;}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);
-}this.el.addClass([this.fieldClass,this.cls]);this.initValue();},applyTo:function(A){this.allowDomMove=false;this.el=Roo.get(A);this.render(this.el.dom.parentNode);return this;},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);
-}},isDirty:function(){if(this.disabled){return false;}return String(this.getValue())!==String(this.originalValue);},afterRender:function(){Roo.form.Field.superclass.afterRender.call(this);this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);
-}},reset:function(){this.setValue(this.resetValue);this.clearInvalid();},initEvents:function(){this.el.on("keydown",this.fireKey,this);this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.el.relayEvent('keyup',this);this.originalValue=this.getValue();
-this.resetValue=this.getValue();},onFocus:function(){if(!Roo.isOpera&&this.focusClass){this.el.addClass(this.focusClass);}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();
-if(!Roo.isOpera&&this.focusClass){this.el.removeClass(this.focusClass);}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);
-}this.fireEvent("blur",this);},isValid:function(A){if(this.disabled){return true;}var B=this.preventMark;this.preventMark=A===true;var v=this.validateValue(this.processValue(this.getRawValue()));this.preventMark=B;return v;},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();
-return true;}return false;},processValue:function(A){return A;},validateValue:function(A){return true;},markInvalid:function(A){if(!this.rendered||this.preventMark){return;}var B=(typeof(this.combo)!='undefined')?this.combo:this;B.el.addClass(this.invalidClass);
-A=A||this.invalidText;switch(this.msgTarget){case 'qtip':B.el.dom.qtip=A;B.el.dom.qclass='x-form-invalid-tip';if(Roo.QuickTips){Roo.QuickTips.enable();}break;case 'title':this.el.dom.title=A;break;case 'under':if(!this.errorEl){var C=this.el.findParent('.x-form-element',5,true);
-this.errorEl=C.createChild({cls:'x-form-invalid-msg'});this.errorEl.setWidth(C.getWidth(true)-20);}this.errorEl.update(A);Roo.form.Field.msgFx[this.msgFx].show(this.errorEl,this);break;case 'side':if(!this.errorIcon){var C=this.el.findParent('.x-form-element',5,true);
-this.errorIcon=C.createChild({cls:'x-form-invalid-icon'});}this.alignErrorIcon();this.errorIcon.dom.qtip=A;this.errorIcon.dom.qclass='x-form-invalid-tip';this.errorIcon.show();this.on('resize',this.alignErrorIcon,this);break;default:var t=Roo.getDom(this.msgTarget);
-t.innerHTML=A;t.style.display=this.msgDisplay;break;}this.fireEvent('invalid',this,A);},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,'tl-tr',[2,0]);},clearInvalid:function(){if(!this.rendered||this.preventMark){return;}var A=(typeof(this.combo)!='undefined')?this.combo:this;
-A.el.removeClass(this.invalidClass);switch(this.msgTarget){case 'qtip':A.el.dom.qtip='';break;case 'title':this.el.dom.title='';break;case 'under':if(this.errorEl){Roo.form.Field.msgFx[this.msgFx].hide(this.errorEl,this);}break;case 'side':if(this.errorIcon){this.errorIcon.dom.qtip='';
-this.errorIcon.hide();this.un('resize',this.alignErrorIcon,this);}break;default:var t=Roo.getDom(this.msgTarget);t.innerHTML='';t.style.display='none';break;}this.fireEvent('valid',this);},getRawValue:function(){var v=this.el.getValue();return v;},getValue:function(){var v=this.el.getValue();
-return v;},setRawValue:function(v){return this.el.dom.value=(v===null||v===undefined?'':v);},setValue:function(v){this.value=v;if(this.rendered){this.el.dom.value=(v===null||v===undefined?'':v);this.validate();}},adjustSize:function(w,h){var s=Roo.form.Field.superclass.adjustSize.call(this,w,h);
-s.width=this.adjustWidth(this.el.dom.tagName,s.width);return s;},adjustWidth:function(A,w){A=A.toLowerCase();if(typeof w=='number'&&Roo.isStrict&&!Roo.isSafari){if(Roo.isIE&&(A=='input'||A=='textarea')){if(A=='input'){return w+2;}if(A=='textarea'){return w-2;
-}}else if(Roo.isOpera){if(A=='input'){return w+2;}if(A=='textarea'){return w-2;}}}return w;}});Roo.form.Field.msgFx={normal:{show:function(A,f){A.setDisplayed('block');},hide:function(A,f){A.setDisplayed(false).update('');}},slide:{show:function(A,f){A.slideIn('t',{stopFx:true}
+,fieldClass:"x-form-field",msgTarget:'qtip',msgFx:'normal',readOnly:false,disabled:false,inputType:undefined,tabIndex:undefined,isFormField:true,hasFocus:false,value:undefined,loadedValue:false,initComponent:function(){Roo.form.Field.superclass.initComponent.call(this);
+this.addEvents({focus:true,blur:true,specialkey:true,change:true,invalid:true,valid:true,keyup:true});},getName:function(){return this.rendered&&this.el.dom.name?this.el.dom.name:(this.hiddenName||'');},onRender:function(ct,A){Roo.form.Field.superclass.onRender.call(this,ct,A);
+if(!this.el){var B=this.getAutoCreate();if(!B.name){B.name=typeof(this.name)=='undefined'?this.id:this.name;}if(!B.name.length){delete B.name;}if(this.inputType){B.type=this.inputType;}this.el=ct.createChild(B,A);}var C=this.el.dom.type;if(C){if(C=='password'){C='text';
+}this.el.addClass('x-form-'+C);}if(this.readOnly){this.el.dom.readOnly=true;}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);}this.el.addClass([this.fieldClass,this.cls]);this.initValue();},applyTo:function(A){this.allowDomMove=false;
+this.el=Roo.get(A);this.render(this.el.dom.parentNode);return this;},initValue:function(){if(this.value!==undefined){this.setValue(this.value);}else if(this.el.dom.value.length>0){this.setValue(this.el.dom.value);}},isDirty:function(){if(this.disabled){return false;
+}return String(this.getValue())!==String(this.originalValue);},resetHasChanged:function(){this.loadedValue=String(this.getValue());},hasChanged:function(){if(this.disabled){return false;}return this.loadedValue!==false&&String(this.getValue())!==this.loadedValue;
+},afterRender:function(){Roo.form.Field.superclass.afterRender.call(this);this.initEvents();},fireKey:function(e){if(e.isNavKeyPress()){this.fireEvent("specialkey",this,e);}},reset:function(){this.setValue(this.resetValue);this.clearInvalid();},initEvents:function(){this.el.on("keydown",this.fireKey,this);
+this.el.on("focus",this.onFocus,this);this.el.on("blur",this.onBlur,this);this.el.relayEvent('keyup',this);this.originalValue=this.getValue();this.resetValue=this.getValue();},onFocus:function(){if(!Roo.isOpera&&this.focusClass){this.el.addClass(this.focusClass);
+}if(!this.hasFocus){this.hasFocus=true;this.startValue=this.getValue();this.fireEvent("focus",this);}},beforeBlur:Roo.emptyFn,onBlur:function(){this.beforeBlur();if(!Roo.isOpera&&this.focusClass){this.el.removeClass(this.focusClass);}this.hasFocus=false;if(this.validationEvent!==false&&this.validateOnBlur&&this.validationEvent!="blur"){this.validate();
+}var v=this.getValue();if(String(v)!==String(this.startValue)){this.fireEvent('change',this,v,this.startValue);}this.fireEvent("blur",this);},isValid:function(A){if(this.disabled){return true;}var B=this.preventMark;this.preventMark=A===true;var v=this.validateValue(this.processValue(this.getRawValue()));
+this.preventMark=B;return v;},validate:function(){if(this.disabled||this.validateValue(this.processValue(this.getRawValue()))){this.clearInvalid();return true;}return false;},processValue:function(A){return A;},validateValue:function(A){return true;},markInvalid:function(A){if(!this.rendered||this.preventMark){return;
+}var B=(typeof(this.combo)!='undefined')?this.combo:this;B.el.addClass(this.invalidClass);A=A||this.invalidText;switch(this.msgTarget){case 'qtip':B.el.dom.qtip=A;B.el.dom.qclass='x-form-invalid-tip';if(Roo.QuickTips){Roo.QuickTips.enable();}break;case 'title':this.el.dom.title=A;
+break;case 'under':if(!this.errorEl){var C=this.el.findParent('.x-form-element',5,true);this.errorEl=C.createChild({cls:'x-form-invalid-msg'});this.errorEl.setWidth(C.getWidth(true)-20);}this.errorEl.update(A);Roo.form.Field.msgFx[this.msgFx].show(this.errorEl,this);
+break;case 'side':if(!this.errorIcon){var C=this.el.findParent('.x-form-element',5,true);this.errorIcon=C.createChild({cls:'x-form-invalid-icon'});}this.alignErrorIcon();this.errorIcon.dom.qtip=A;this.errorIcon.dom.qclass='x-form-invalid-tip';this.errorIcon.show();
+this.on('resize',this.alignErrorIcon,this);break;default:var t=Roo.getDom(this.msgTarget);t.innerHTML=A;t.style.display=this.msgDisplay;break;}this.fireEvent('invalid',this,A);},alignErrorIcon:function(){this.errorIcon.alignTo(this.el,'tl-tr',[2,0]);},clearInvalid:function(){if(!this.rendered||this.preventMark){return;
+}var A=(typeof(this.combo)!='undefined')?this.combo:this;A.el.removeClass(this.invalidClass);switch(this.msgTarget){case 'qtip':A.el.dom.qtip='';break;case 'title':this.el.dom.title='';break;case 'under':if(this.errorEl){Roo.form.Field.msgFx[this.msgFx].hide(this.errorEl,this);
+}break;case 'side':if(this.errorIcon){this.errorIcon.dom.qtip='';this.errorIcon.hide();this.un('resize',this.alignErrorIcon,this);}break;default:var t=Roo.getDom(this.msgTarget);t.innerHTML='';t.style.display='none';break;}this.fireEvent('valid',this);},getRawValue:function(){var v=this.el.getValue();
+return v;},getValue:function(){var v=this.el.getValue();return v;},setRawValue:function(v){return this.el.dom.value=(v===null||v===undefined?'':v);},setValue:function(v){this.value=v;if(this.rendered){this.el.dom.value=(v===null||v===undefined?'':v);this.validate();
+}},adjustSize:function(w,h){var s=Roo.form.Field.superclass.adjustSize.call(this,w,h);s.width=this.adjustWidth(this.el.dom.tagName,s.width);return s;},adjustWidth:function(A,w){A=A.toLowerCase();if(typeof w=='number'&&Roo.isStrict&&!Roo.isSafari){if(Roo.isIE&&(A=='input'||A=='textarea')){if(A=='input'){return w+2;
+}if(A=='textarea'){return w-2;}}else if(Roo.isOpera){if(A=='input'){return w+2;}if(A=='textarea'){return w-2;}}}return w;}});Roo.form.Field.msgFx={normal:{show:function(A,f){A.setDisplayed('block');},hide:function(A,f){A.setDisplayed(false).update('');}},slide:{show:function(A,f){A.slideIn('t',{stopFx:true}
 );},hide:function(A,f){A.slideOut('t',{stopFx:true,useDisplay:true});}},slideRight:{show:function(A,f){A.fixDisplay();A.alignTo(f.el,'tl-tr');A.slideIn('l',{stopFx:true});},hide:function(A,f){A.slideOut('l',{stopFx:true,useDisplay:true});}}};
 // Roo/form/TextField.js
 Roo.form.TextField=function(A){Roo.form.TextField.superclass.constructor.call(this,A);this.addEvents({autosize:true});};Roo.extend(Roo.form.TextField,Roo.form.Field,{grow:false,growMin:30,growMax:800,vtype:null,maskRe:null,disableKeyFilter:false,allowBlank:true,minLength:0,maxLength:Number.MAX_VALUE,minLengthText:"The minimum length for this field is {0}",maxLengthText:"The maximum length for this field is {0}",selectOnFocus:false,blankText:"This field is required",validator:null,regex:null,regexText:"",emptyText:null,initEvents:function(){if(this.emptyText){this.el.attr('placeholder',this.emptyText);
@@ -1172,21 +1173,23 @@ if(!cn.match(/x-ed-loc-/)){return;}var n=cn.split('-').pop();var B=this.footerEl
 Roo.form.BasicForm=function(el,A){this.allItems=[];this.childForms=[];Roo.apply(this,A);this.items=new Roo.util.MixedCollection(false,function(o){return o.id||(o.id=Roo.id());});this.addEvents({beforeaction:true,actionfailed:true,actioncomplete:true});if(el){this.initEl(el);
 }Roo.form.BasicForm.superclass.constructor.call(this);};Roo.extend(Roo.form.BasicForm,Roo.util.Observable,{timeout:30,activeAction:null,trackResetOnLoad:false,childForms:false,allItems:false,waitMsgTarget:false,initEl:function(el){this.el=Roo.get(el);this.id=this.el.id||Roo.id();
 this.el.on('submit',this.onSubmit,this);this.el.addClass('x-form');},onSubmit:function(e){e.stopEvent();},isValid:function(){var A=true;this.items.each(function(f){if(!f.validate()){A=false;}});return A;},isDirty:function(){var A=false;this.items.each(function(f){if(f.isDirty()){A=true;
-return false;}});return A;},doAction:function(A,B){if(typeof A=='string'){A=new Roo.form.Action.ACTION_TYPES[A](this,B);}if(this.fireEvent('beforeaction',this,A)!==false){this.beforeAction(A);A.run.defer(100,A);}return this;},submit:function(A){this.doAction('submit',A);
-return this;},load:function(A){this.doAction('load',A);return this;},updateRecord:function(A){A.beginEdit();var fs=A.fields;fs.each(function(f){var B=this.findField(f.name);if(B){A.set(f.name,B.getValue());}},this);A.endEdit();return this;},loadRecord:function(A){this.setValues(A.data);
-return this;},beforeAction:function(A){var o=A.options;if(this.waitMsgTarget===true){this.el.mask(o.waitMsg||"Sending",'x-mask-loading');}else if(this.waitMsgTarget){this.waitMsgTarget=Roo.get(this.waitMsgTarget);this.waitMsgTarget.mask(o.waitMsg||"Sending",'x-mask-loading');
-}else{Roo.MessageBox.wait(o.waitMsg||"Sending",o.waitTitle||this.waitTitle||'Please Wait...');}},afterAction:function(A,B){this.activeAction=null;var o=A.options;if(this.waitMsgTarget===true){this.el.unmask();}else if(this.waitMsgTarget){this.waitMsgTarget.unmask();
-}else{Roo.MessageBox.updateProgress(1);Roo.MessageBox.hide();}if(B){if(o.reset){this.reset();}Roo.callback(o.success,o.scope,[this,A]);this.fireEvent('actioncomplete',this,A);}else{if((typeof(A.result)!='undefined')&&(typeof(A.result.errors)!='undefined')&&(typeof(A.result.errors.needs_confirm)!='undefined')){var _t=this;
-Roo.MessageBox.confirm("Change requires confirmation",A.result.errorMsg,function(r){if(r!='yes'){return;}_t.doAction('submit',{params:{_submit_confirmed:1}});});return;}Roo.callback(o.failure,o.scope,[this,A]);if(!this.hasListener('actionfailed')){Roo.MessageBox.alert("Error",(typeof(A.result)!='undefined'&&typeof(A.result.errorMsg)!='undefined')?A.result.errorMsg:"Saving Failed, please check your entries or try again");
+return false;}});return A;},hasChanged:function(){var A=false;this.items.each(function(f){if(f.hasChanged()){A=true;return false;}});return A;},resetHasChanged:function(){this.items.each(function(f){f.resetHasChanged();});},doAction:function(A,B){if(typeof A=='string'){A=new Roo.form.Action.ACTION_TYPES[A](this,B);
+}if(this.fireEvent('beforeaction',this,A)!==false){this.beforeAction(A);A.run.defer(100,A);}return this;},submit:function(A){this.doAction('submit',A);return this;},load:function(A){this.doAction('load',A);return this;},updateRecord:function(A){A.beginEdit();
+var fs=A.fields;fs.each(function(f){var B=this.findField(f.name);if(B){A.set(f.name,B.getValue());}},this);A.endEdit();return this;},loadRecord:function(A){this.setValues(A.data);return this;},beforeAction:function(A){var o=A.options;if(this.waitMsgTarget===true){this.el.mask(o.waitMsg||"Sending",'x-mask-loading');
+}else if(this.waitMsgTarget){this.waitMsgTarget=Roo.get(this.waitMsgTarget);this.waitMsgTarget.mask(o.waitMsg||"Sending",'x-mask-loading');}else{Roo.MessageBox.wait(o.waitMsg||"Sending",o.waitTitle||this.waitTitle||'Please Wait...');}},afterAction:function(A,B){this.activeAction=null;
+var o=A.options;if(this.waitMsgTarget===true){this.el.unmask();}else if(this.waitMsgTarget){this.waitMsgTarget.unmask();}else{Roo.MessageBox.updateProgress(1);Roo.MessageBox.hide();}if(B){if(o.reset){this.reset();}Roo.callback(o.success,o.scope,[this,A]);
+this.fireEvent('actioncomplete',this,A);}else{if((typeof(A.result)!='undefined')&&(typeof(A.result.errors)!='undefined')&&(typeof(A.result.errors.needs_confirm)!='undefined')){var _t=this;Roo.MessageBox.confirm("Change requires confirmation",A.result.errorMsg,function(r){if(r!='yes'){return;
+}_t.doAction('submit',{params:{_submit_confirmed:1}});});return;}Roo.callback(o.failure,o.scope,[this,A]);if(!this.hasListener('actionfailed')){Roo.MessageBox.alert("Error",(typeof(A.result)!='undefined'&&typeof(A.result.errorMsg)!='undefined')?A.result.errorMsg:"Saving Failed, please check your entries or try again");
 }this.fireEvent('actionfailed',this,A);}},findField:function(id){var A=this.items.get(id);if(!A){this.items.each(function(f){if(f.isFormField&&(f.dataIndex==id||f.id==id||f.getName()==id)){A=f;return false;}});}return A||null;},addForm:function(A){if(this.childForms.indexOf(A)>-1){return;
 }this.childForms.push(A);var n='';Roo.each(A.allItems,function(fe){n=typeof(fe.getName)=='undefined'?fe.name:fe.getName();if(this.findField(n)){return;}var B=new Roo.form.Hidden({name:n});B.render(this.el);this.add(B);},this);},markInvalid:function(A){if(A instanceof Array){for(var i=0,B=A.length;
 i<B;i++){var C=A[i];var f=this.findField(C.id);if(f){f.markInvalid(C.msg);}}}else{var D,id;for(id in A){if(typeof A[id]!='function'&&(D=this.findField(id))){D.markInvalid(A[id]);}}}Roo.each(this.childForms||[],function(f){f.markInvalid(A);});return this;}
 ,setValues:function(A){if(A instanceof Array){for(var i=0,B=A.length;i<B;i++){var v=A[i];var f=this.findField(v.id);if(f){f.setValue(v.value);if(this.trackResetOnLoad){f.originalValue=f.getValue();}}}}else{var C,id;for(id in A){if(typeof A[id]!='function'&&(C=this.findField(id))){if(C.setFromData&&C.valueField&&C.displayField&&(C.store&&!C.store.isLocal)){var sd={}
-;sd[C.valueField]=typeof(A[C.hiddenName])=='undefined'?'':A[C.hiddenName];sd[C.displayField]=typeof(A[C.name])=='undefined'?'':A[C.name];C.setFromData(sd);}else{C.setValue(A[id]);}if(this.trackResetOnLoad){C.originalValue=C.getValue();}}}}Roo.each(this.childForms||[],function(f){f.setValues(A);
-});return this;},getValues:function(A){if(this.childForms){Roo.each(this.childForms,function(f){this.setValues(f.getValues());},this);}var fs=Roo.lib.Ajax.serializeForm(this.el.dom);if(A===true){return fs;}return Roo.urlDecode(fs);},getFieldValues:function(A){if(this.childForms){Roo.each(this.childForms,function(f){this.setValues(f.getValues());
-},this);}var B={};this.items.each(function(f){if(!f.getName()){return;}var v=f.getValue();if(f.inputType=='radio'){if(typeof(B[f.getName()])=='undefined'){B[f.getName()]='';}if(!f.el.dom.checked){return;}v=f.el.dom.value;}if((typeof(v)=='object')&&f.getRawValue){v=f.getRawValue();
-}if(f.name!=f.getName()){B[f.name]=f.getRawValue();}B[f.getName()]=v;});return B;},clearInvalid:function(){this.items.each(function(f){f.clearInvalid();});Roo.each(this.childForms||[],function(f){f.clearInvalid();});return this;},reset:function(){this.items.each(function(f){f.reset();
-});Roo.each(this.childForms||[],function(f){f.reset();});return this;},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this;},remove:function(A){this.items.remove(A);return this;},render:function(){this.items.each(function(f){if(f.isFormField&&!f.rendered&&document.getElementById(f.id)){f.applyTo(f.id);
+;sd[C.valueField]=typeof(A[C.hiddenName])=='undefined'?'':A[C.hiddenName];sd[C.displayField]=typeof(A[C.name])=='undefined'?'':A[C.name];C.setFromData(sd);}else{C.setValue(A[id]);}if(this.trackResetOnLoad){C.originalValue=C.getValue();}}}}this.resetHasChanged();
+Roo.each(this.childForms||[],function(f){f.setValues(A);f.resetHasChanged();});return this;},getValues:function(A){if(this.childForms){Roo.each(this.childForms,function(f){this.setValues(f.getValues());},this);}var fs=Roo.lib.Ajax.serializeForm(this.el.dom);
+if(A===true){return fs;}return Roo.urlDecode(fs);},getFieldValues:function(A){if(this.childForms){Roo.each(this.childForms,function(f){this.setValues(f.getValues());},this);}var B={};this.items.each(function(f){if(!f.getName()){return;}var v=f.getValue();
+if(f.inputType=='radio'){if(typeof(B[f.getName()])=='undefined'){B[f.getName()]='';}if(!f.el.dom.checked){return;}v=f.el.dom.value;}if((typeof(v)=='object')&&f.getRawValue){v=f.getRawValue();}if(f.name!=f.getName()){B[f.name]=f.getRawValue();}B[f.getName()]=v;
+});return B;},clearInvalid:function(){this.items.each(function(f){f.clearInvalid();});Roo.each(this.childForms||[],function(f){f.clearInvalid();});return this;},reset:function(){this.items.each(function(f){f.reset();});Roo.each(this.childForms||[],function(f){f.reset();
+});return this;},add:function(){this.items.addAll(Array.prototype.slice.call(arguments,0));return this;},remove:function(A){this.items.remove(A);return this;},render:function(){this.items.each(function(f){if(f.isFormField&&!f.rendered&&document.getElementById(f.id)){f.applyTo(f.id);
 }});return this;},applyToFields:function(o){this.items.each(function(f){Roo.apply(f,o);});return this;},applyIfToFields:function(o){this.items.each(function(f){Roo.applyIf(f,o);});return this;}});Roo.BasicForm=Roo.form.BasicForm;
 // Roo/form/Form.js
 Roo.form.Form=function(A){var B=[];if(A.items){B=A.items;delete A.items;}Roo.form.Form.superclass.constructor.call(this,null,A);this.url=this.url||this.action;if(!this.root){this.root=new Roo.form.Layout(Roo.applyIf({id:Roo.id()},A));}this.active=this.root;