EasyUI Forum
June 17, 2024, 07:57:40 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Poll
Question: How to load plugin before populating data into the datagrid.
email - 0 (0%)
email - 0 (0%)
Total Voters: 0

Pages: [1]
  Print  
Author Topic: Grid does not display with data  (Read 10001 times)
ggeller
Newbie
*
Posts: 3


View Profile
« 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
Logged
ggeller
Newbie
*
Posts: 3


View Profile
« Reply #1 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>
<%
}
%>
« Last Edit: May 20, 2014, 01:22:39 PM by ggeller » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #2 on: May 20, 2014, 05:16:01 PM »

Please refer to these tutorials http://www.jeasyui.com/tutorial/index.php#datagrid
Logged
ggeller
Newbie
*
Posts: 3


View Profile
« Reply #3 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?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!