EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: can2pic on May 11, 2013, 02:29:05 AM



Title: Transform DataGrid from Table with dynamic data
Post by: can2pic 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


Title: Re: Transform DataGrid from Table with dynamic data
Post by: Kevin 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')
   }
});


Title: Re: Transform DataGrid from Table with dynamic data
Post by: can2pic 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