我试图在单击按钮时提交表单,但是它并不像我想象的那么简单,我总是最终得到一个fp.getForm不是一个函数,尽管提交处理程序是直接取自 ExtJs 文档,有什么线索吗?
Players.panel.Subscription = function(config) {
config = config || {};
Ext.apply(config,{
border: false
,baseCls: 'modx-formpanel'
,process: 'mgr/player/getSubscribers'
,standardSubmit: true
,url: Players.config.connectorUrl
,baseParams: { action: 'mgr/player/getSubscribers' }
,buttons: [{
text: 'Export er'
,formBind: true
,type: 'submit'
,handler: function(){
var fp = this.ownerCt.ownerCt,
form = fp.getForm();
if (form.isValid()) {
// check if there are baseParams and if
// hiddent items have been added already
if (fp.baseParams && !fp.paramsAdded) {
// add hidden items for all baseParams
for (i in fp.baseParams) {
fp.add({
xtype: 'hidden',
name: i,
value: fp.baseParams[i]
});
}
fp.doLayout();
// set a custom flag to prevent re-adding
fp.paramsAdded = true;
}
form.submit();
}
}
}]
});
Players.panel.Subscription.superclass.constructor.call(this,config);
};
我还尝试将基类从modx-formpanel 替换为formpanel和basicform,但没有成功。
谢谢