EasyUI Forum

General Category => General Discussion => Topic started by: enber79 on June 29, 2016, 12:25:27 AM



Title: Datagrid load data
Post by: enber79 on June 29, 2016, 12:25:27 AM
Hi all. I have a site that contain 4 datagrid. When you enter the site you only see one, and clicking in different buttons load window component with datagrid inside. The problem is that when you enter the site, all datagrid data is loaded (shown and hidden datagrid's), and this ofc is a several load impact. ¿Can I load datagrid data only when I go to show that datagrid?

Thanks


Title: Re: Datagrid load data
Post by: jarry on June 29, 2016, 05:37:52 PM
You can use the delay loading tech to define your window.
Code:
<div class="easyui-window" data-options="closed:true,href:'content.php'"></div>
As the code above shows, the window's content isn't loaded until you open it. All the window content including the datagrid can be placed in the 'content.php' page.

If you only want to delay loading data into datagrid, just remove the 'url' property value. When the window opened, call 'load' method to reload its data.
Code:
$('#dg').datagrid('load', url);