Using column.render when no data is present

Using column.render when no data is present

mikeosoftmikeosoft Posts: 40Questions: 14Answers: 2

I have some checkbox columns which I want to render specific string if checked. However the table is initially empty and fills up when the user adds data along time.
This combination leads to an alert box saying "Requested unknown parameter....".

It seems that if I remove the rendering function, the error goes away.
Is there a way to avoid the alert message?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @mikeosoft ,

    That sounds odd, would you be able to on link to a test case that shows that problem?

    Cheers,

    Colin

  • mikeosoftmikeosoft Posts: 40Questions: 14Answers: 2

    Here it is
    http://live.datatables.net/bohaqeke/1/

    I used my editor js files because it seems those on the examples pages are not the same code.

  • mikeosoftmikeosoft Posts: 40Questions: 14Answers: 2

    As a side note, the problem happen when I want to add a new line, via method addNewLineHabiletes

  • allanallan Posts: 63,457Questions: 1Answers: 10,465 Site admin
    Answer ✓

    Most likely you need to use columns.defaultContent to tell DataTables what data it should use if there isn't a data point for the column in question for the current row.

    I don't actually check a conditional check on a checkbox value in your rendering functions and the code doesn't actually run for me, so I'm not certain where the error is. Can you copy / paste the error message in please?

    Allan

  • mikeosoftmikeosoft Posts: 40Questions: 14Answers: 2

    Hi,
    The defaultContent did the trick! Thank you

    FYI, the message was : DataTables warning: table id=tab_174f418de0e04b5b832a774aff803f49tableHabiletes - Requested unknown parameter 'estAssistant' for row 0, column 1. For more information about this error, please see http://datatables.net/tn/4

This discussion has been closed.