1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    9
    Vote Rating
    1
    mar2020 is on a distinguished road

      0  

    Default success function - for succes:false response

    success function - for succes:false response


    My ajax request return json string like this

    {"success":false} but this execute success function. When failure should by execute ?

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Location
    Jakarta
    Posts
    30
    Vote Rating
    2
    arivwd is on a distinguished road

      0  

    Default


    Can u show the form creation code here?

  3. #3
    Sencha User
    Join Date
    Apr 2011
    Posts
    9
    Vote Rating
    1
    mar2020 is on a distinguished road

      0  

    Default


    The code looks like this:
    Code:
            Ext.Ajax.request({
                    url: 'course/setchapterstatus',
                    params: {                    
                        chapter_id: chapter_id,
                        status: status
                    },
                    success: function(response){
                        console.log('update success');
                    },
                    
                    failure: function(form, action) {
                        console.log('update fail');
                    }
                    });

  4. #4
    Sencha User
    Join Date
    Mar 2012
    Location
    Jakarta
    Posts
    30
    Vote Rating
    2
    arivwd is on a distinguished road

      0  

    Default


    I cant see the form create or submit code here..
    But maybe you can start here : http://docs.sencha.com/ext-js/4-1/#!/guide/forms
    Look at the "Handling Data" part.


    Just remember that the default form submit is in Ajax except you define it as "standardSubmit: true"

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,003
    Vote Rating
    650
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    The ajax request doesn't inspect the responseText at all, there's no assuming it has to be JSON.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Thread Participants: 2