Results 1 to 3 of 3

Thread: extJS4 Ext.Window no submit?

  1. #1
    Sencha User
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    9

    Default Answered: extJS4 Ext.Window no submit?

    Hello, what's wrong, I call with a button in another form, a new window. This is a form and a submit button. However, I can not perform submit, the url is not addressed? There is also no error message in Firebug. Succes is true.

    Code:
    var bannerform = new Ext.Window({
        title: 'Banner',
        id: 'bannerwindow',
        height: 475,
        width: 530,
        layout: 'fit',
        items: [
            {
                xtype: 'form',
                height: 394,
                method: 'GET',
                autoScroll: true,
                bodyPadding: 10,
                preventHeader: true,
                id: 'bannerform',
                title: 'bannerform',
                ref: 'bannerform',
                items: [
                    {
                        xtype: 'textfield',
                        id: 'headline',
                        fieldLabel: 'berschrift',
                        anchor: '100%'
                    },
                    {
                        xtype: 'htmleditor',
                        height: 150,
                        id: 'description',
                        style: 'background-color: white;',
                        fieldLabel: 'Beschreibung',
                        anchor: '100%'
                    },
                    {
                        xtype: 'filefield',
                        fieldLabel: 'Grafik',
                        buttonText: 'Hochladen ...',
                        anchor: '100%'
                    }
                ]
            }
        ],
        dockedItems: [
            {
                xtype: 'toolbar',
                dock: 'bottom',
                items: [
                    {
                        xtype: 'tbfill'
                    },
                    {
                        xtype: 'button',
                        text: 'Banner speichern',
                        margin: '2 10 5 10',
                        height: 35,
                        width: 130,
                        handler:function(){
                            var bannerform = Ext.getCmp('bannerform').getForm();
                            console.log('Window', bannerform);
                            console.log('Values', bannerform.getValues()); // its ok
                            bannerform.submit({
                                url: 'test.php',
                                success: function ( bannerform, action ) {
                                    Ext.Msg.alert('Status', 'Banner wurde gespeichert.'); 
                                },
                                failure: function() {
                                    Ext.Msg.alert('Status', 'Es ist ein Fehler aufgetreten!');                                                        
                                }
                            });    
                        }
                    },
                    {
                        xtype: 'button',
                        text: 'Fenster schlieen',
                        margin: '2 10 5 10',
                        height: 35,
                        width: 130,
                        handler:function(){
                            Ext.getCmp('bannerwindow').close();
                        }
                    }
                ]
            }
        ]
    });
    Here is the call
    Code:
    ...
    {
        xtype: 'button',
        margin: '25 0 25 35',
        padding: 10,
        text: 'Banner hinzufgen',
        handler: function(){
        bannerform.show();      
     }
    ...

    1. You are reusing the bannerform variable
    2. You are using Ext.getCmp for other purposes than debugging
    3. What debugging have you done?

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    1. You are reusing the bannerform variable
    2. You are using Ext.getCmp for other purposes than debugging
    3. What debugging have you done?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    9

    Default

    Thank you for your answer, the problem is now solved.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •