Hybrid View

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    24
    Vote Rating
    0
    Enrico.Massone is on a distinguished road

      0  

    Default Hide a message box after a certain time duration

    Hide a message box after a certain time duration


    Good day everyone,
    I'm working with ExtJS 4.1 and I'm trying to write a code to automatically hide an alert message box after a certain time duration.
    I typed following code:

    Ext.Msg.alert('Error', 'form is not valid');
    function hide_message()
    {
    Ext.MessageBox.hide().defer(5000);
    }
    hide_message();


    but it doesn't work and it raises the following exception:

    Uncaught TypeError: Cannot call method 'defer' of undefined

    What's the matter with that code, and how can I modify it to reach my goal?

    Thanks in advance guys.

  2. #2
    Touch Premium Member
    Join Date
    Feb 2011
    Location
    NJ
    Posts
    311
    Vote Rating
    52
    droessner is a jewel in the rough droessner is a jewel in the rough droessner is a jewel in the rough

      0  

    Default


    Code:
    Ext.Msg.alert('Error', 'form is not valid');
    function hide_message() {
        Ext.defer(function() {
            Ext.MessageBox.hide();
        }, 5000);
    }
    hide_message();

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    24
    Vote Rating
    0
    Enrico.Massone is on a distinguished road

      0  

    Default Hide a message box after a certain time duration

    Hide a message box after a certain time duration


    Quote Originally Posted by droessner View Post
    Code:
    Ext.Msg.alert('Error', 'form is not valid');
    function hide_message() {
        Ext.defer(function() {
            Ext.MessageBox.hide();
        }, 5000);
    }
    hide_message();
    Thank you very much !

  4. #4
    Sencha Premium Member
    Join Date
    Jun 2012
    Posts
    63
    Vote Rating
    4
    team.avesta is on a distinguished road

      0  

    Smile See this link///


Thread Participants: 2