EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: JeroenNL on August 31, 2014, 07:28:45 AM



Title: change progress indicator of messager
Post by: JeroenNL on August 31, 2014, 07:28:45 AM
Hello there,

I'd like to use the progress option of the messager plugin when loading data from my server. Messager shows a progress indicator in percentages. I have no way to determine what the progress actually is (what percentage) so I'd like to show a simple animated busyindicator gif instead. How can I achieve that with messager?

Cheers,
Jeroen


Title: Re: change progress indicator of messager
Post by: stworthy on August 31, 2014, 03:31:02 PM
Please use the alert message window to display an animating gif.
Code:
var s = '<span class="tree-loading" style="display:inline-block;width:16px;height:24px;vertical-align:middle"></span><span style="display:inline-block;line-height:24px;vertical-align:middle;"> Processing...</span>';
$.messager.alert('My Title',s);


Title: Re: change progress indicator of messager
Post by: JeroenNL on September 02, 2014, 12:03:32 PM
Thanks stworthy, but using an alert window won't work for me because it has an OK button and can't be closed via code.

Can I use messager.show somehow and close the window via javascript?


Title: Re: change progress indicator of messager
Post by: stworthy on September 02, 2014, 05:29:52 PM
Yes, you can use $.messager.show to display a animating gif.
Code:
var s = '<span class="tree-loading" style="display:inline-block;width:16px;height:24px;vertical-align:middle"></span><span style="display:inline-block;line-height:24px;vertical-align:middle;"> Processing...</span>';
var win = $.messager.show({
title:'My Title',
msg:s,
showType:'fade',
timeout:0,
style:{
right:'',
bottom:''
}
});
To close the message window, call 'close' method on this window.
Code:
win.window('close');