1. #1
    Ext JS Premium Member breckster's Avatar
    Join Date
    Mar 2008
    Posts
    116
    Vote Rating
    0
    breckster is on a distinguished road

      0  

    Default Ext.TabPanel beforetabchange event

    Ext.TabPanel beforetabchange event


    I need to perform a Ajax call during this event in order to validate data. I need a way of delaying while the results of the ajax request are returned. So if needed I can return false thus maintaining the focus on the current tab. I have tried suspend and resume without much luck. I'm not looking for code just ideas.
    -->

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    544
    Vote Rating
    51
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    One possibility:

    Use a flag (such as valid=false). If flag = false, return false to cancel tab change and perform your Ajax call. On success set the flag to true, and fire the method to change your tab again (flag is now true, therefore Ajax call will not be performed, and the tab will successfully change). Finally, reset your flag back to false
    -->

  3. #3
    Ext JS Premium Member breckster's Avatar
    Join Date
    Mar 2008
    Posts
    116
    Vote Rating
    0
    breckster is on a distinguished road

      0  

    Default


    Quote Originally Posted by willigogs View Post
    One possibility:

    Use a flag (such as valid=false). If flag = false, return false to cancel tab change and perform your Ajax call. On success set the flag to true, and fire the method to change your tab again (flag is now true, therefore Ajax call will not be performed, and the tab will successfully change). Finally, reset your flag back to false
    Thanks for the idea ... but I have multiple Ajax calls .. and sequencing them became a pain.
    I decided to use async: false

    Thanks for the reply.
    -->

Thread Participants: 1