jQWidgets Forums

This topic contains 2 replies, has 2 voices, and was last updated by  jimg 11 years, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Open event Posts
  • Open event #48232

    jimg
    Participant

    Is the “open” event for windows intended to act like a “beforeOpen” event? We’re trying to use a modal window as a “working…” indicator when executing code that compresses a large string that takes up to 12 seconds on some of the android devices we’re testing on. On desktop machines this code takes only a second to execute. The “open” window event triggers execution of this code. I was expecting to see the window appear before the code executes. On desktop machines, the window gets to about 75% opacity before the code finishes executing and then closes the window. On Android and iOS tablets, the window never even appears. Here’s a simplified version of our code:

    $(“#myWindow”).jqxWindow({ height: 150, width: 300, theme: ‘myTheme’, isModal: true, autoOpen: false });
    $(‘#myWindow’).on(‘open’, function (event) {
    DoSignificantWork();
    });

    DoSignificantWork = function () {
    ‘use strict’;

    try {
    //Code that does significant work goes here

    $(“#myWindow”).jqxWindow(‘close’);

    } catch (err) {
    logError(‘DoSignificantWork’, err);
    }
    }

    Is there some way to actually get the window to appear before executing code that takes some time?

    Open event #48234

    Peter Stoev
    Keymaster

    Hi jimg,

    The “open” event is currently raised when you call the “open” method. If you want the event to be raised when the window is already opened and fully visible i.e after its display Animation, set the showAnimationDuration to 0. Example: http://jsfiddle.net/jqwidgets/JAQPN/

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Open event #48239

    jimg
    Participant

    When I set showAnimationDuration to 0 in the context of my code, the window never appears. Yet when the “close” command executes the transparent gray background appears and doesn’t disappear. I tried setting closeAnimationDuration to 0 too and got the same results.

    Strangely, in a Chrome desktop browser and on an iPad, if I set showAnimationduration to 1000, the window appears with full opacity and then disappears when the “close” command executes. But on an Android tablet the window never appears.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.