有一段代码,放到extjs官网的论坛上,同时所以提到这里来:
同时也可以参考这里:http://www.sencha.com/forum/showthread.php?135592-button-disabled-and-submit-form-bug
[code="javascript"]
[/code]
这段代码,执行的时候把form提交了,但是disabled已经设置true了,不想让它提交。
其实是这样的,在Ext3.3.1中有如下代码:
[code="javascript"]
// private
onClick : function(e){
if(e){
e.preventDefault();
}
if(e.button !== 0){
return;
}
if(!this.disabled){
this.doToggle();
if(this.menu && !this.hasVisibleMenu() && !this.ignoreNextClick){
this.showMenu();
}
this.fireEvent('click', this, e);
if(this.handler){
//this.el.removeClass('x-btn-over');
this.handler.call(this.scope || this, this, e);
}
}
},
[/code]
这个代码没有被调用到,而是直接调用了form的提交。而这点跟Ext2.0是不兼容的,在2.0里不会提交表格。