How Do I allow nullable columns/ Preventing DataTables warning: Requested unknown parameter x

How Do I allow nullable columns/ Preventing DataTables warning: Requested unknown parameter x

addice1984addice1984 Posts: 4Questions: 1Answers: 0

I am using datatables with server-side processing. However, I realize that I will always get

DataTables warning: table id=example2 - Requested unknown parameter 'x' for row 0. For more information about this error, please see http://datatables.net/tn/4

as long as one column is null.

How do I get about preventing getting this error?

Thanks

Answers

  • allanallan Posts: 61,920Questions: 1Answers: 10,152 Site admin

    Did you have a read through the tech note linked to in the error message, and specifically the Resolution section?

    Allan

  • addice1984addice1984 Posts: 4Questions: 1Answers: 0

    Hi Allan,
    Thanks for the input.
    I guess this link would be closer to what I wanted.

    http://datatables.net/reference/option/columns.render

    Because I need the column for display and it may contain nullable value, I had done this:

    {
    "mData": "column1",
    "render": function ( data, type, full, meta ) {
    //console.log("Hello I am rendering...");
    return data == null ? "" :data;
    } },

  • allanallan Posts: 61,920Questions: 1Answers: 10,152 Site admin

    That looks like it should work. Does it not? If not, can you link to a test page showing the issue please?

    Allan

  • addice1984addice1984 Posts: 4Questions: 1Answers: 0

    Yes Allan, it works, for my case. :-) The warning no longer pops up after I implemented it.

This discussion has been closed.