EasyUI Forum
May 08, 2024, 02:39:46 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Transform DataGrid from Table with dynamic data  (Read 7562 times)
can2pic
Newbie
*
Posts: 6


View Profile
« on: May 11, 2013, 02:29:05 AM »

I have converted a html table to a datagrid, the original table had one column of cells updated dynamically @ ~500ms intervals using
Code:
 [size=10pt]<td id = "dynamicdata1">0</td>
Code:
document.getElementById('dynamicdata1').innerHTML =(tmp?'1':'0');
How would I  go about this in the datagrid?

Thanks

Paul
Logged
Kevin
Jr. Member
**
Posts: 52


View Profile Email
« Reply #1 on: May 11, 2013, 08:12:26 AM »

Use the updateRow method. As per the documentation (rownumber, would be a row counter var);

$('#dg').datagrid('updateRow',{
   index: rownumber,
   row: {
      colname: (tmp?'1':'0')
   }
});
Logged
can2pic
Newbie
*
Posts: 6


View Profile
« Reply #2 on: May 12, 2013, 12:52:01 PM »

Kevin,

Thank you, that worked, I had tried updateRow from the documentation but must have had a syntax error and failed to get it to work, your example helped.

Paul
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!