jQWidgets Forums
jQuery UI Widgets › Forums › Dialogs and Notifications › Window › Forcing Window to Invalidate
This topic contains 2 replies, has 2 voices, and was last updated by csoga 12 years, 3 months ago.
-
Author
-
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 CommunitySpecify Criteria to Assign Contacts to CommunityAssign All Existing Contacts For Selected Customer:
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,
DimitarjQWidgets team
http://www.jqwidgets.com/Thanks Dimitar! I tried it and it worked:-)
Highly appreciate the insight and help!
Cyril
-
AuthorPosts
You must be logged in to reply to this topic.