EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: sky-t on September 05, 2016, 01:59:10 AM



Title: Show Messager in div
Post by: sky-t on September 05, 2016, 01:59:10 AM
Is there a possibilty to display the messager window in a specific div container?


Title: Re: Show Messager in div
Post by: jarry on September 05, 2016, 08:14:19 AM
Please extend a method 'appendTo' to append the window to a special <div> element.
Code:
<script>
(function($){
$.extend($.fn.window.methods, {
appendTo: function(jq, to){
return jq.each(function(){
var state = $(this).data('window');
$(this).window('window').appendTo(to);
$(state.mask).appendTo(to);
$(state.shadow).appendTo(to);
});
}
});
})(jQuery);
</script>

The code below shows how to show a messager window in a '#cc' div container.
Code:
var d = $.messager.alert({
title: 'My Title',
msg: 'Here is an error message.',
icon: 'error',
inline: true
});
d.dialog('appendTo', '#cc');
d.dialog('resize').dialog('center');