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"

viralviral Posts: 8Questions: 0Answers: 0
edited December 2011 in General
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

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Try setting sDefaultContent to be an empty string for that column.

    Allan
  • viralviral Posts: 8Questions: 0Answers: 0
    Hello 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]
This discussion has been closed.