1. #1
    Sencha User
    Join Date
    Jun 2011
    Posts
    9
    Vote Rating
    0
    madhusanmani is on a distinguished road

      0  

    Default confirmation message and beforerender in extjs

    confirmation message and beforerender in extjs


    Hi All,

    I am having mutiple panels, when the user edit and click on other tabpanel, user should get a confirmation message saying that "whether they need o save the changes",when i tried to implement this its going to next panel and then showing the Confirmation message.

    As per the requirement user should get the confirmation message in the current panel,but the current implementation traverse to next panel and then it displays teh confirmation message.

    Thanks in Advance,
    Madhu

  2. #2
    Sencha - Services Team
    Join Date
    Aug 2007
    Posts
    98
    Vote Rating
    0
    mdlincoln is on a distinguished road

      0  

    Default


    You probably want to use the beforetabchange event. Then you can check the data and return false to prevent the navigation to the new tab.

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Posts
    9
    Vote Rating
    0
    madhusanmani is on a distinguished road

      0  

    Default


    Hi,

    I am using before render tab event , but the application wont wait until the user secltes yes/no from the confirmation message.
    which will traverse to the next tab and then it will display the message, "whether you want to move to other tab"

  4. #4
    Sencha User
    Join Date
    Jun 2011
    Posts
    9
    Vote Rating
    0
    madhusanmani is on a distinguished road

      0  

    Default


    Hi,

    Thanks for the reply,
    i am using beforetab change method as shown below.

    but the message is getting displayed and the application wont wait for the user to clik either Yes r no button.

    sg.bia.panel.BIATabPanel=Ext.extend(BIATabPanel, Ext.TabPanel, {
    centerPanelText:'Center Panel',
    listeners: {
    beforetabchange: function(tabpanel, newTab, oldTab){
    // headerTabCancel ia method
    var resultHeader1 = headerTabCancel(cancel_header_flag);
    if(resultHeader1==true){
    return false;
    }
    return true;
    }
    }
    });


    function headerTabCancel(cancel_header_flag){
    if(cancel_header_flag==true){
    Ext.MessageBox.confirm('Confirm Action', 'Do you wish to continue?. Changes will not be saved in Header', function(response) {

    if (response == 'yes') {
    return false;
    }else if(response == 'no'){
    return true;
    }
    });

    }

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Posts
    9
    Vote Rating
    0
    madhusanmani is on a distinguished road

      0  

    Default


    Hi,

    cancel_header_flag is varibale which is created as a global variable, so no compillation errors.

  6. #6
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default You Should Use 'beforetabchange' Event

    You Should Use 'beforetabchange' Event


    beforetabchange( this,newTab,currentTab )
    This event fires before the active tab changes.
    It takes three arguments:
    • this: TabPanel
    • newTab: The tab being activated in the tabpanel.
    • currentTab: The cuurent active tab in the tabpanel.

      So, Your Code will be something like this:
    Code:
    beforeTabChange: function() {
           this.showConfirmation();
    }

    Code:
    showConfirmation: function() {
       Ext.Msg.show({
         title:'Save Changes?'
         , msg:'Would you like to save your changes before changing the current tab?'
         , buttons:Ext.Msg.YESNOCANCEL   
          , fn: processResult
         , animEl:'elId'
         , icon:Ext.MessageBox.QUESTION
       });
    }
    

    If You Still Get Some Issues, Please Let Me Know.

  7. #7
    Sencha User
    Join Date
    Jun 2011
    Posts
    9
    Vote Rating
    0
    madhusanmani is on a distinguished road

      0  

    Default


    i have implemented this, the message box will be displayed once the tabchange events occurs. The tab change even should occur only based on User input Yes/No.

    Can any one help me how to suspend tab change event in beforetabchangeevent method.

    which will solve my problem.

  8. #8
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default check this


  9. #9
    Sencha User
    Join Date
    Jun 2011
    Posts
    9
    Vote Rating
    0
    madhusanmani is on a distinguished road

      0  

    Default


    HI ,

    Thanks a lot, its working fine..

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi