EasyUI Forum

General Category => General Discussion => Topic started by: simplescience on June 04, 2015, 08:17:07 AM



Title: Stop display of datagrid until data is fully loaded?
Post by: simplescience on June 04, 2015, 08:17:07 AM
Is there a way to stop the display of an edatagrid until all the data is loaded - potentially showing a loading spinner?


Title: Re: Stop display of datagrid until data is fully loaded?
Post by: stworthy on June 04, 2015, 08:30:11 AM
You can create the datagrid and then hide it. When the data is loaded successfully, display the panel again and resize the datagrid.
Code:
$('#tt').edatagrid({
    onLoadSuccess:function(){
        $(this).edatagrid('getPanel').panel('open');
        $(this).edatagrid('resize');
    }
}).edatagrid('getPanel').panel('close');


Title: Re: Stop display of datagrid until data is fully loaded?
Post by: simplescience on June 04, 2015, 11:41:21 AM
Thanks for that.  It works.  I did need to hide the table header as well, and show it when done.  However, that did work.

Thanks again.