Is there a way to make the progress indicator always display in the center of the screen rather than in the center of the warp?
Nevermind, I found my answer.
Hi,
It is possible to set location of WARP indicator dynamically, however, it is not a public feature. If you want to experiment, then you may look at implementation of ig_shared.js. You may find that the WARP.fixPI member function is used before indicator is shown. Also setLocation supports explicit location if passed object is not number, but has x/y members. So, at the end of your initialize function, you may add something like below
//pi.setLocation(ig_Location.MiddleCenter); oPanel._oldFixPI = oPanel.fixPI;oPanel.fixPI = function(pi){ this._oldFixPI(pi); var body = document.body; var html = body.parentNode; // or better var y = body.scrollTop, x = body.scrollLeft, w = body.offsetWidth, h = body.offsetHeight; if(y == 0) { y = html.scrollTop; x = html.scrollLeft; w = html.clientWidth; // or better h = html.clientHeight; } if(w > 0) x += w / 2 - 275 / 2; if(h > 0) y += h / 2 - 85 / 2; pi.setLocation({x:x, y:y});}
It recognizes the pi.setRelativeContainer just fine.
The problem, I believe, is that the container is being set to document.body. My page is very long and therefore the center of document.body is not the center of the screen.
I need a way to make the progress indicator always show in the center of the screen, not necessarily the center of the body.
I tested those codes and they worked correctly. The only thing I can think about, is that you have older version of Shared.dll which does not have member function setRelativeContainer of WARP. In this case instead of local property used by WARP, you may try to configure global indicator object. Example:
if(pi.setRelativeContainer) pi.setRelativeContainer(document.body);else{ var indicator = new ig_progressIndicator(); indicator.setRelativeContainer(document.body); ig_shared.getCBManager()._indicators = [indicator];}
I actually am still having a problem. I am trying to center my progress indicator in the middle of the screen, not necessarily the middle of the warp. Here is my code:
function warp_InitializePanel_withWait(oPanel){ var pi = oPanel.getProgressIndicator(); pi.setTemplate('<table style="width: 275px; height: 85px; background-color:White; border: thin double #000000">' + '<tr>' + '<td style="width: 260px; text-align: center; height: 45px;">' + '<span style="font-family: Tahoma; font-weight: bold; font-size: 16px;">' + 'System Processing Request, Please Wait...</span>' + '</td>' + '</tr>' + '<tr>' + '<td style="text-align: center; width: 260px;">' + '<img src="images/ActivityBar.gif" />' + '</td>' + '</tr>' + '</table>'); pi.setRelativeContainer(document.body); pi.setLocation(ig_Location.MiddleCenter); }
The problem is it is still centering it on the warp, not on the page.
For everyone else following along, the answer is yes. You can use the client-side object model to control the appearance and position of the WARP's progress indicator. Here's the link to the online help content which lists the API available - http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WebAsyncRefreshPanel_ProgressIndicator_Object.html