表单提交忽略url选项

时间:2011-08-16 20:39:02

标签: extjs modx

我正在尝试以标准方式提交ExtJs表单,但表单始终提交到同一页面我不知道为什么尽管url config选项设置正确

Players.panel.Subscription = function(config) {
    config = config || {};
    Ext.apply(config,{
        id : 'players-subscription-home'
        ,border: false
        ,baseCls: 'modx-formpanel'
        ,standardSubmit: true
        ,baseParams: { action: 'mgr/player/getSubscribers' }
        ,url: Players.config.connectorUrl
        ,buttons: [{
            text: 'Export Subscribers'
            ,type: 'submit'
            ,handler:  function(){
                var fp = this.ownerCt.ownerCt,
                    form = fp.getForm();
                alert(fp.url);
                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);
};

Ext.extend(Players.panel.Subscription,MODx.FormPanel);
Ext.reg('players-subscription-home',Players.panel.Subscription);

感谢。

1 个答案:

答案 0 :(得分:0)

我会通过使用您认为正在设置的硬编码网址替换此行来进行故障排除:  Players.config.connectorUrl

然后看看你是否仍然看到相同的行为。