<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>
This topic is archived.