Using embedded Ruby to fill table, results in fixedColumn failure
Using embedded Ruby to fill table, results in fixedColumn failure
I am using Rails 4 and DataTables 1.10.6. I have a table being filled dynamically with data from my controllers, and as a result it seems as though the fixedColumn extension will only work with my header row, which has a statically defined left column.
My header row has:
<tr class="profile-header">
<td></td> <!-- blank holder -->
...
</tr>
...and this works fine. The blank cell remains and the other headers flow underneath it. But, in my table body I use:
<tr class="profile-row">
<td class="profile-header">Poop</td>
<% for week in @weeks %>
<% if week.is_a? Hash %>
<td class=""></td>
<% else %>
<td class=""><%= week.send field.to_sym %></td>
<% end %>
<% end %>
</tr>
...and all columns simply scroll left and nothing remains. My jQuery looks as follows:
var table = $("table.specialest").DataTable({
scrollX: true,
paging: false,
ordering: false,
fixedColumns: true
});
...and I do see the following error: Uncaught TypeError: Cannot read property 'anCells' of undefined