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

      0  

    Default Editor Grid is not loading the data once it is saved or updated

    Editor Grid is not loading the data once it is saved or updated


    http://74.54.196.178/~ganpati/extjs/

    the php file is http://74.54.196.178/~ganpati/extjs/early-call.phps

    When I save data, it saves it to db but does not reflect in grid immediately(not everytime). Keep trying to add and it happens.

  2. #2
    Ext User
    Join Date
    Oct 2008
    Location
    Ger
    Posts
    178
    Vote Rating
    0
    tubamanu is on a distinguished road

      0  

    Default


    can u explain your problem with some more details....cannot understand it..

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

      0  

    Default


    Quote Originally Posted by tubamanu View Post
    can u explain your problem with some more details....cannot understand it..
    Hi,

    Go to the above said url and click "Add category". Now add something and save it. It should save the data to db and reload the grid with new data.

    But when you save the data (both in "Add category" and inline-edit ) it does not load the saved data and this problem occurs sometimes, not necessarily everytime.

    Hope it make senses ?


    Regards,

  4. #4
    Ext User
    Join Date
    Oct 2008
    Location
    Ger
    Posts
    178
    Vote Rating
    0
    tubamanu is on a distinguished road

      0  

    Default


    think that your problem is, that you refresh your store during save / update process on database. can that be ?
    maybe your store refresh is faster then saving/update action on serverside.
    if this is your problem, u can avoid it, if u wait until u get a serverresponse when updating/creating a new entry, and then reload your store.

  5. #5
    Ext User
    Join Date
    Sep 2009
    Posts
    11
    Vote Rating
    0
    gajendrabang is on a distinguished road

      0  

    Default


    Quote Originally Posted by tubamanu View Post
    think that your problem is, that you refresh your store during save / update process on database. can that be ?
    maybe your store refresh is faster then saving/update action on serverside.
    if this is your problem, u can avoid it, if u wait until u get a serverresponse when updating/creating a new entry, and then reload your store.

    ya, I tried to add a two second delay before loading the grid and after saving data. but not working properly. Could you please suggest something else.

    here is the php file http://74.54.196.178/~ganpati/extjs/early-call.txt

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    save() is asynchronous, so you'll have to wait until the server responds (which can be a bit tricky, because a save can consist of multiple requests).

    Assuming your server sends the correct response to the create, update and/or delete requests you don't need to reload the store at all.

  7. #7
    Ext User
    Join Date
    Oct 2008
    Location
    Ger
    Posts
    178
    Vote Rating
    0
    tubamanu is on a distinguished road

      0  

    Default


    think that sending your php script to sleep is not the right way here.....as condor said, u need to wait for response of your server.....

    can look like this:

    Code:
                        Ext.Ajax.request({  
                                url : saveURL,
                                success: function ( result, request) { 
                                    // when server answers, reloadstore 
                                    store.reload();
                                    dlgPopup.destroy();    
                                }
                            });

    if nothing at all helps, u can also call an defer-function using extjs.....but its quite a bit dirty :X

  8. #8
    Ext User
    Join Date
    Sep 2009
    Posts
    11
    Vote Rating
    0
    gajendrabang is on a distinguished road

      0  

    Default


    Quote Originally Posted by tubamanu View Post
    think that sending your php script to sleep is not the right way here.....as condor said, u need to wait for response of your server.....

    can look like this:

    Code:
                        Ext.Ajax.request({  
                                url : saveURL,
                                success: function ( result, request) { 
                                    // when server answers, reloadstore 
                                    store.reload();
                                    dlgPopup.destroy();    
                                }
                            });
    if nothing at all helps, u can also call an defer-function using extjs.....but its quite a bit dirty :X

    Ok, I will try with AJAX

  9. #9
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    FYI, I created a feature request to help with this problem.

  10. #10
    Ext User
    Join Date
    Sep 2009
    Posts
    11
    Vote Rating
    0
    gajendrabang is on a distinguished road

      0  

    Thumbs up


    Quote Originally Posted by Condor View Post
    FYI, I created a feature request to help with this problem.

    That's great. Thank you

Thread Participants: 2