*/
success : false,
/**
- * @cfg {boolean|String} valid true/false or string (add/sub/ok/nodrop)
+ * @cfg {boolean|String} valid true/false or string (ok-add/ok-sub/ok/nodrop)
* if the drop point is valid for over/enter..
*/
valid : false,
/**
* @hide
*/
- notifyEnter : function(dd, e, data){
+ notifyEnter : function(dd, e, data)
+ {
this.valid = true;
this.fireEvent('enter', dd, e, data);
if(this.overClass){
/**
* @hide
*/
- notifyOver : function(dd, e, data){
+ notifyOver : function(dd, e, data)
+ {
this.valid = true;
this.fireEvent('over', dd, e, data);
return typeof(this.valid) == 'string' ? 'x-dd-drop-' + this.valid : (
/**
* @hide
*/
- notifyOut : function(dd, e, data){
+ notifyOut : function(dd, e, data)
+ {
this.fireEvent('out', dd, e, data);
if(this.overClass){
this.el.removeClass(this.overClass);
/**
* @hide
*/
- notifyDrop : function(dd, e, data){
+ notifyDrop : function(dd, e, data)
+ {
this.success = false;
this.fireEvent('drop', dd, e, data);
return this.success;
}
},
- onSpecialKey : function(field, e){
+ onSpecialKey : function(field, e)
+ {
//Roo.log('editor onSpecialKey');
if(this.completeOnEnter && e.getKey() == e.ENTER){
e.stopEvent();
this.completeEdit();
- }else if(this.cancelOnEsc && e.getKey() == e.ESC){
- this.cancelEdit();
- }else{
- this.fireEvent('specialkey', field, e);
+ return;
}
+ // do not fire special key otherwise it might hide close the editor...
+ if(e.getKey() == e.ENTER){
+ return;
+ }
+ if(this.cancelOnEsc && e.getKey() == e.ESC){
+ this.cancelEdit();
+ return;
+ }
+ this.fireEvent('specialkey', field, e);
+
},
/**
* @cfg {Boolean} fileUpload
* Set to true if this form is a file upload.
*/
+ /**
+ * @cfg {Roo.form.LayoutDialog} dialog
+ * If you set this to a Roo.form.Dialog, it will get masked when saving..
+ */
/**
* @cfg {Object} baseParams
* Parameters to pass with all requests. e.g. baseParams: {id: '123', foo: 'bar'}.
*/
+ /**
+
/**
* @cfg {Number} timeout Timeout for form actions in seconds (default is 30 seconds).
*/
// private
beforeAction : function(action){
var o = action.options;
+
+ if (this.dialog) {
+ o.waitMsg = o.waitMsg || true;
+ o.waitMsgTarget = this.dialog.el;
+ }
if(o.waitMsg){
if(this.waitMsgTarget === true){
this.el.mask(o.waitMsg, 'x-mask-loading');
}
Roo.callback(o.success, o.scope, [this, action]);
this.fireEvent('actioncomplete', this, action);
+
}else{
Roo.callback(o.failure, o.scope, [this, action]);
+ // show an error message if no failed handler is set..
+ if (!this.hasListener('actionfailed')) {
+ Roo.MessageBox.alert("Error", "Saving Failed, please check your entries");
+ }
+
this.fireEvent('actionfailed', this, action);
}
+
},
/**
// default connection failure
failure : function(response){
+
this.response = response;
this.failureType = Roo.form.Action.CONNECT_FAILURE;
this.form.afterAction(this, false);
}
+
Roo.Ajax.request(Roo.apply(this.createCallback(), {
form:this.form.el.dom,
url:this.getUrl(!isPost),
Roo.MessageBox.hide();
}
+
var result = this.processResponse(response);
if(result === true || result.success){
this.form.afterAction(this, true);
Roo.MessageBox.hide();
}
+
this.response = response;
this.failureType = Roo.form.Action.CONNECT_FAILURE;
this.form.afterAction(this, false);
type : 'load',
run : function(){
+
Roo.Ajax.request(Roo.apply(
this.createCallback(), {
method:this.getMethod(),
},
success : function(response){
+
var result = this.processResponse(response);
if(result === true || !result.success || !result.data){
this.failureType = Roo.form.Action.LOAD_FAILURE;