Avoid Error "Requested unknown parameter '2' from the data source for row 13"
Avoid Error "Requested unknown parameter '2' from the data source for row 13"
I am getting error because datatable is looking at data source for array position 2 and not finding it. I am trying to avoid it because, I get array from server and want to display in two columns. However, the in_groups_of(2,false) gives odd data [13/2 = 7 in one column and 6 in another ] the datatables error out "Requested Unknown Parameter "
[code]<% @music.in_groups_of(2, false) do |row_music| %>
<% for music in row_music %>
<%= path.value %>
<!-- This is for other column -->
<% end %>
<% end %>[/code]
Javascript code
[code]var oTable = $("#example").dataTable();[/code]
So I am trying to avoid this error.
Can any one point out suggestion?
Thanks
Viral
[code]<% @music.in_groups_of(2, false) do |row_music| %>
<% for music in row_music %>
<%= path.value %>
<!-- This is for other column -->
<% end %>
<% end %>[/code]
Javascript code
[code]var oTable = $("#example").dataTable();[/code]
So I am trying to avoid this error.
Can any one point out suggestion?
Thanks
Viral
This discussion has been closed.
Replies
Allan
thanks for prompt response. However, the SDefaultContent still give same error.
"DataTables warning (table id = 'music'): Unexpected number of TD elements. Expected 28 and got 27. DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination."
In this case, how can i use sDefaultContent, as I know i will only get 27 TD elements instead of 28 [in this particular case]
[code]
var oTable = $("#example").dataTable({
"aoColumns": [
null,
{ "sDefaultContent": "null" }
]
});
[/code]