EasyUI Forum

General Category => General Discussion => Topic started by: ggeller on May 20, 2014, 12:50:45 PM



Title: Grid does not display with data
Post by: ggeller on May 20, 2014, 12:50:45 PM
Hi All,

I am new to jquery and have a question.

I have a page that I use the datagrid on. I can see that it builds the table initially with the data but the EasyUI datagrid is not loaded yet. After that the plugin gets loaded and the datagrid displays without the data. I read about $(document).ready(function(){}); I put an alert in that call. When the alert pops up, I see the table with the data loaded before the plugin is loaded. What do I need to do to get the datagrid to load up before I try to populate it?

Sorry for the newbie question. Any help would be greatly appreciated.

Thank you,

Greg


Title: Re: Grid does not display with data
Post by: ggeller on May 20, 2014, 01:05:34 PM
Does the datagrid only except json data? I am iterating over a result set and building the cells as it iterates.

This what I am doing.

<table class="easyui-datagrid" border="0" cellpadding="2" cellspacing="0" style="width:1008px;height:500px" data-options="singleSelect:true">
<thead data-options="frozen:true">
<tr>
<th data-options="width:40,height:40,align:'center'">I.D.</th>
<th data-options="width:40,height:40,align:'center'">Start Date</th>
<th data-options="width:40,height:40,align:'center'">End Date</th>
<th data-options="width:40,height:40,align:'center'">Name</th>
</tr>
</thead>
<thead>
<tr>
<th data-options="width:40,height:40,align:'center'" >Street</th>
<th data-options="width:40,height:40,align:'center'" >City</th>
<th data-options="width:40,height:40,align:'center'" >Zip Code</th>
</tr>
</thead>       

<%
while(details.next() ) {
%>
<tr>
<td><%=details.getString(ID)%></td>
<td><%=details.getString(START_DATE)%></td>
<td><%=details.getString(END_DATE)%></td>
<td><%=details.getString(NAME)%></td>
<td><%=details.getString(STREET)%></td>
<td><%=details.getString(CITY)%></td>
<td><%=details.getString(ZIP_CODE)%></td>
</tr>
<%
}
%>


Title: Re: Grid does not display with data
Post by: stworthy on May 20, 2014, 05:16:01 PM
Please refer to these tutorials http://www.jeasyui.com/tutorial/index.php#datagrid


Title: Re: Grid does not display with data
Post by: ggeller on May 20, 2014, 08:39:30 PM
Thank you for the quick reply.

I am not that familiar with php. The web app is written in java and I am using the data grid on a jsp page. Is there a way to bind the table to a Map?