Thank you,
Forcing the cell types worked.
However, while using the following code i can only see the table headers.
Can I use all the api functionality (grouping, attaching events, etc) while initializing from html table ?
I am using ruby on rails.
Thank you
<table id=“tblToGrid” style=“width:600px” imgpath="…/…/images/" border=“1” lightnavigation=“true”>
Division |
Engine Type |
Sales 06 |
Sales 07 |
Actual/Forecast 08 |
<%
@reps.each do |rep| %>
<%= rep.division %> |
<%= rep.engine_type1 %> |
<%= number_to_currency(rep.actuals_06.to_f, :precision =>0) %> |
<%= number_to_currency(rep.actuals_07.to_f, :precision =>0) %> |
<%= number_to_currency(rep.actuals_08.to_f, :precision =>0) %> |
<% end %>
You need not duplicate commands and use grid.init() in case of loading from HTML, after dhtmlXGridFromTable command you already have configured and initialized grid.
The correct code will look as
<table id=“tblToGrid” style=“width:600px” imgpath="…/…/images/" border=“1” lightnavigation=“true”>
Division |
Engine Type |
Sales 06 |
Sales 07 |
Actual/Forecast 08 |
<%
@reps.each do |rep| %>
<%= rep.division %> |
<%= rep.engine_type1 %> |
<%= number_to_currency(rep.actuals_06.to_f, :precision =>0) %> |
<%= number_to_currency(rep.actuals_07.to_f, :precision =>0) %> |
<%= number_to_currency(rep.actuals_08.to_f, :precision =>0) %> |
<% end %>
If you really need to set width|types and etc. by separate js command, it also possible but will require more complex syntax ( I can describe if it really necessary)
>>I am using ruby on rails.
Ruby has neat xml related functionality, so it not a problem to use default loadXML approach with ruby as well ( can provide sample if necessary )