1. #1
    Ext User
    Join Date
    May 2009
    Posts
    11
    Vote Rating
    0
    samwalker121 is on a distinguished road

      0  

    Default Submit button error

    Submit button error


    This submit button won't work and I can't figure out why..?

    Code:
    {
                        text: 'Submit',
                        
                        handler: function () {
                            app.elements.grid.commitChanges(app.elements.mainWindow.getForm());
                            method: 'POST';
                            action: 'test.php';
                        }
                    }
    Should be simple shouldn't it? What could it be?

  2. #2
    Sencha User
    Join Date
    Nov 2007
    Posts
    135
    Vote Rating
    0
    new2ext is on a distinguished road

      0  

    Default


    For starters, you should read the API. Your mixing and matching options that don't belong.

    Your button handler() should be calling your form's submit().
    http://extjs.com/deploy/dev/docs/?cl...&member=submit

    Submit options
    http://extjs.com/deploy/dev/docs/?cl...ember=doAction

  3. #3
    Ext User
    Join Date
    May 2009
    Posts
    11
    Vote Rating
    0
    samwalker121 is on a distinguished road

      0  

    Default


    Thanks new2ext, however I don't quite understand what you are saying.

    Should I do this?
    Code:
    {
                        text: 'Submit',
                        
                        handler: function () {
                        myFormPanel.getForm().submit({
        app.elements.grid.commitChanges(app.elements.mainWindow.getForm());
                            method: 'POST';
                            action: 'test.php';
                        }
    }
                    }
    Please tell me what I'm doing wrong Much appreciated.

  4. #4
    Sencha User
    Join Date
    Nov 2007
    Posts
    135
    Vote Rating
    0
    new2ext is on a distinguished road

      0  

    Default


    Look at your code and ask your self what each line does.
    Code:
    {
      text: 'Submit',
      handler: function () {
        myFormPanel.getForm().submit({
          app.elements.grid.commitChanges(app.elements.mainWindow.getForm());  //Why do you have this?
          method: 'POST';
          action: 'test.php';  //Why do you have this?
        }
      }
    }
    Use the API. The submit() accepts the following options
    http://extjs.com/deploy/dev/docs/?cl...ember=doAction
    1. url
    2. method
    3. params
    4. headers
    5. success
    6. failure
    7. scope
    8. clientValidation

    Compare this list to what your using in your code

  5. #5
    Sencha Premium Member kimosabi's Avatar
    Join Date
    Jan 2008
    Location
    Perth, Western Australia
    Posts
    49
    Vote Rating
    0
    kimosabi is on a distinguished road

      0  

    Default


    Thats better, but I don't understand why you are including this line:
    Code:
    app.elements.grid.commitChanges(app.elements.mainWindow.getForm());
    If you have a grid that displays data that is saved in the form, you might just want to reload the grid after the form has returned successfully:

    Code:
    {
                        text: 'Submit',
                        
                        handler: function () {
                                myFormPanel.getForm().submit({
                                    url: 'test.php',
                                    success:function(form,action){
                                          app.elements.grid.reload();
                                    }
                                });
                        }
    }
    Cheers,
    Sabi

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar