You can use the delay loading tech to define your window.
<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.
$('#dg').datagrid('load', url);