:: Forum >>

Loading, Please wait ...

Hi
I read everything I found on the forum but without success. At least not understandable for me :o)
Every post seems so old so i was wondering the feature has been implemented but I cannot find anything about it.

Is anybody have a exemple to use a "Loading, Please wait ..." message or a loading.gif?

Thanks for any clue

J
Jerome
Monday, February 22, 2010
Hi Jerome,
Some time ago I had the need to find some kind of solution to completely LOCK the grid while doing some processing and tried it by disable/enable any user event that could interfere.
But found an easier way by replacing the scrolltemplate with a transparent span where I can place text and images.

http://www.activewidgets.com/javascript.forum.21532.1/loading-message-inside-scrolltemplate.html

As this sample involves some complex code for using this approach with paging and sorting, I made a simpler one for you.
HTH
<script>
var obj = new AW.UI.Grid;
obj.setCellData(function(col, row){return col + "." + row});
obj.setHeaderText(function(col){return 'header - ' + col });
obj.setColumnCount(10);
obj.setRowCount(400);

document.write(obj);

document.write("<br>");

var button = new AW.UI.Button;
button.setControlText("Do something with loading ...");
document.write(button);


button.onControlClicked = function(){
var millisecondstimeoutdelay ;
this.setControlDisabled(true);
obj.LoadingMessage( true, "- Loading Page # ", 'lightblue');
obj.refresh();

// Your proccess code here , It would change millisecondstimeoutdelay variable to
// ensure proccess ending before showing the grid again
millisecondstimeoutdelay = 1700;

this.setTimeout( function(){ ///--------------/// START TIMEOUT
obj.LoadingMessage(false);
obj.refresh();
this.setControlDisabled(false);
},millisecondstimeoutdelay); //---------------// END TIMEOUT
}


obj.LoadingMessage = function( bool, msg, color ){
if (bool){
this.defineControlProperty('SavedScroll', ''); //// new property to store default scroll-template
this.setControlSavedScroll(this.getScrollTemplate().getContent('box'));
var LoadSpan = new AW.HTML.SPAN;
LoadSpan.setId('LoadingSpn')
LoadSpan.setStyle('height', '100%');
LoadSpan.setStyle('width', '100%');
LoadSpan.setStyle('background-color', color );
LoadSpan.setStyle('background-repeat', 'no-repeat');
LoadSpan.setStyle('z-index', '10000');
LoadSpan.setStyle('position', 'absolute');
LoadSpan.setStyle('opacity', '0.8');
LoadSpan.setStyle('-moz-opacity', '0.8');
LoadSpan.setStyle('filter', 'alpha(opacity=80)');
LoadSpan.setStyle('font-size', '20');
LoadSpan.setContent('html', msg + '</br>');
LoadSpan.setContent('html', LoadSpan.getContent('html')+ ', Please wait' + '</br>');
LoadSpan.setContent('html', LoadSpan.getContent('html')+'<img src=' + "../../runtime/styles/xp/combo.png" + '></img>');

this.getScrollTemplate().setContent('box',LoadSpan);
}

if (!bool){
this.getScrollTemplate().setContent('box', this.getControlSavedScroll() );
}
}
</script>
Carlos
Tuesday, February 23, 2010

This topic is archived.


Back to support forum

Forum search