jQWidgets Forums

jQuery UI Widgets Forums Dialogs and Notifications Window Forcing Window to Invalidate

Tagged: ,

This topic contains 2 replies, has 2 voices, and was last updated by  csoga 12 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Forcing Window to Invalidate #17500

    csoga
    Participant

    Hi,

    I’m looking to display a progress image in a DIV on a Modal Window when a button in the Window is clicked. Unfortunately the image is not displayed until the synchronous method I’m invoking to perform a long process on the server returns and I display an alert.

    My goal is to display the progress image before the method is invoked, then hid it when it returns. Any idea what I’m doing wrong?

    Below is the code snippets.

    function AssignCommunityContacts(comm_Id)
    {
    //Set up the window…
    $(“#conLangList”).jqxDropDownList({ source: languages, selectedIndex: -1, width: ‘267’, height: ’23’, theme: theme, dropDownHeight: 100});
    $(“#commAssignmentCancelButton”).jqxButton({ theme: buttontheme, width: ’80px’, height: ’25px’, disabled: false });
    $(“#commConAssignButton”).jqxButton({ theme: buttontheme, width: ‘120px’, height: ’25px’, disabled: false });
    $(‘#CommunityAssignmentWindow’).jqxWindow({ theme: ‘classic’, width: 710,
    height: 420, position: { x: 150, y: 275 }, resizable: false, isModal: true, autoOpen: true, cancelButton: $(“#commAssignmentCancelButton”)});

    //Open the window
    $(‘#CommunityAssignmentWindow’).jqxWindow(‘setTitle’, ‘Assign Contacts to Community’);
    $(‘#CommunityAssignmentWindow’).jqxWindow(‘show’);

    }; //end of AssignCommunityContacts()

    $(‘#commConAssignButton’).bind(‘click’, function ()
    {
    //Set the progress image and text
    obj=document.getElementById(‘progressArea’);
    obj.innerHTML=”Assigning contacts, please wait… “;

    //Invoke synchronous AJAX method to save contacts
    SaveCommunityContacts();

    //Clear the progress image
    obj.innerHTML=””;
    $(‘#commConAssignButton’).jqxButton({disabled: false });

    });

    Assign Contacts to Community
    Specify Criteria to Assign Contacts to Community

    Assign All Existing Contacts For Selected Customer:

    Forcing Window to Invalidate #17551

    Dimitar
    Participant

    Hello csoga,

    A possible solution is to set a timeout, i.e.:

    $('#commConAssignButton').bind('click', function () {
    //Set the progress image and text
    obj = document.getElementById('progressArea');
    obj.innerHTML = "Assigning contacts, please wait… ";
    setTimeout(function () {
    //Invoke synchronous AJAX method to save contacts
    SaveCommunityContacts();
    //Clear the progress image
    obj.innerHTML = "";
    $('#commConAssignButton').jqxButton({ disabled: false });
    }, 1000);
    });

    Best Regards,
    Dimitar

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

    Forcing Window to Invalidate #17582

    csoga
    Participant

    Thanks Dimitar! I tried it and it worked:-)

    Highly appreciate the insight and help!

    Cyril

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

You must be logged in to reply to this topic.