We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51749
    • 1 Posts
    Hi. What am I doing wrong?
    W1.panel.Settings = function (config) {
        config = config || {};
        this.ident = config.ident || 'meuitem' + Ext.id();
        Ext.applyIf(config, {
            id: 'w1-form-settings'
            , renderTo: Ext.getBody()
            , width: 600
            , layout: 'anchor'
            , items: [
                {
                    xtype: 'fieldset',
                    title: 'Поля, обязательные для заполнения',
                    defaultType: 'textfield', // each item will be a checkbox
                    layout: 'anchor',
                    items: [{
                        xtype: 'textfield',
                        fieldLabel: 'addsfrg',
                        name: 'merchant_id',
                    }
                    ,{
                        xtype: 'textfield',
                        fieldLabel: _('w1_signature'),
                        name: 'signature',
                    }
                    ,{
                        xtype: 'textfield',
                        fieldLabel: _('w1_recipient_login'),
                        name: 'recipient_login',
                        value: 'email',
                    }
                    ,{
                        xtype: 'w1-combo-units',
                        fieldLabel: _('w1_currency_id'),
                        name: 'currency_id',
                    }]
                },
                
            ]
            ,listeners: {
                render: function(p) {
                    MODx.Ajax.request({
                        url: W1.config.connector_url
                        ,params: {
                            action: 'mgr/settings/getlist',
                        },
                        listeners: {
                            'success': {fn:function(r) {
                                //this.getForm().reset();
                                //this.getForm().setValues(r.results);
      
                            }, scope:this}
                        }
                    });
                }
            }
            // Reset and Submit buttons
            ,buttons: [
                {
                    text: 'Reset',
                    handler: function() {
                        this.up('form').getForm().reset();
                    }
                }, 
                {
                    text: 'Submit',
                    /*formBind: true, //only enabled once the form is valid
                    disabled: true,*/
                    handler: function() {
                        var form = this.up('form').getForm();
                        if (form.isValid()) {
                            form.submit({
                                success: function(form, action) {
                                   Ext.Msg.alert('Success', action.result.msg);
                                },
                                failure: function(form, action) {
                                    Ext.Msg.alert('Failed', action.result.msg);
                                }
                            });
                        }
                    }
                }
            ],
        });
        W1.panel.Settings.superclass.constructor.call(this, config);
    };
    Ext.extend(W1.panel.Settings, MODx.FormPanel);
    Ext.reg('w1-form-settings', W1.panel.Settings);
    

    Сreated only inputs without label.