Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJS-6745
in
a recent build.
-
Sencha User
4.1.1 GA Form Submit Problem
Test Case:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="Extjs/resources/css/ext-all.css"/>
<script type="text/javascript" src="Extjs/bootstrap.js"></script>
</head>
<body>
<script type="text/javascript">
Ext.onReady(function(){
if(Ext.BLANK_IMAGE_URL.substr(0,4)!="data"){
Ext.BLANK_IMAGE_URL="./images/s.gif";
}
Ext.create("Ext.panel.Panel",{
title:"",
width:400,
height:400,
renderTo:Ext.getBody(),
bodyStyle:"background:#DFE9F6",
layout:"hbox",
defaults:{xtype:"form",bodyPadding:5,
bodyStyle:"background:#DFE9F6",flex:1,height:350,
url:"Validation.asp",
defaultType:"textfield",
fieldDefaults:{labelWidth:80,
labelSeparator:"?",anchor:"0"
},
bbar:[
{text:"Save",handler:function(){
var f=this.up("form").getForm();
if(f.isValid())
f.submit({
waitMsg: "Save……",
waitTitle: "Save",
});
}}
]
},
items:[
{title:"JSON",
items:[
{fieldLabel:"field1",name:"field1"},
{fieldLabel:"field2",name:"field2",msgTarget:"side"},
{fieldLabel:"field3",name:"field3",msgTarget:"title"},
{fieldLabel:"field4",name:"field4",msgTarget:"under"},
{fieldLabel:"field5",name:"field5",msgTarget:"label1"},
{xtype:"label",id:"label1"}
]}
]
})
});
</script>
</body>
</html>
Validation.asp
Code:
<%
Response.Charset="utf-8"
Response.ContentType="text/javascript"
%>
{
"success": false,
"errors": {
"field1": "requires"
}
}
Click save button,result:
1.PNG
-
Thank you for the report.
Scott.
-
Sencha User
how to solve it templary?
-
Since it was working in RC2, you can have a look at that part of the code and create an override.
Scott.
-
Workaround is to add this override:
Code:
Ext.define('Ext.form.SubmitFix', {
override: 'Ext.ZIndexManager',
register : function(comp) {
var me = this,
compAfterHide = comp.afterHide;
if (comp.zIndexManager) {
comp.zIndexManager.unregister(comp);
}
comp.zIndexManager = me;
me.list[comp.id] = comp;
me.zIndexStack.push(comp);
// Hook into Component's afterHide processing
comp.afterHide = function() {
compAfterHide.apply(comp, arguments);
me.onComponentHide(comp);
};
},
/**
* Unregisters a {@link Ext.Component} from this ZIndexManager. This should not
* need to be called. Components are automatically unregistered upon destruction.
* See {@link #register}.
* @param {Ext.Component} comp The Component to unregister.
*/
unregister : function(comp) {
var me = this,
list = me.list;
delete comp.zIndexManager;
if (list && list[comp.id]) {
delete list[comp.id];
// Relinquish control of Component's afterHide processing
delete comp.afterHide;
Ext.Array.remove(me.zIndexStack, comp);
// Destruction requires that the topmost visible floater be activated. Same as hiding.
me._activateLast();
}
}
});
-
Sencha Premium Member
Applying the patch
This might be a newb question, but how to do you apply this patch?
do you simply copy paste it in your code and it should do the job?
Thanks
-
Correct.. The best option is to create a separate override.js file and include it directly after ext-all.js for example.
Scott.
-
Sencha Premium Member
Fixed in 4.1.3
Confirmed this was only a 4.1.1 issue, the included patch is in 4.1.3
Ext-4.2.1 / Windows 7 SP1 / Firefox 24 / Firebug 1.12.2