Problem using checkbox column

Problem using checkbox column

galcottgalcott Posts: 53Questions: 15Answers: 1

I'm using the Select extension and want to have a checkbox column in my table. The table is defined like this, as the checkbox is to go in the last column.

<TABLE ID=tblAutopay><THEAD><TR><TH>Order #</TH><TH>Date</TH><TH>Patient</TH><TH>Amount</TH><TH></TH></TR></THEAD></TABLE>

I set the columnDefs to:

      columnDefs: [ { targets: 4, className: 'select-checkbox' } ]

When the table loads I get an error "Requested unknown parameter '4' for row 0, column 4'. But the checkboxes display and function normally.

I tried adding "data: null" to the column definition. In that case there's no error message, but very strangely the checkbox column displays all the fields in the row as well as the checkbox, like this.

So what is going on here and how do I fix it?

This question has an accepted answers - jump to answer

Answers

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

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • kthorngrenkthorngren Posts: 21,183Questions: 26Answers: 4,925
    Answer ✓

    Add columns.defaultContent to that column. Set it to an empty string, for example: defaultContent: ""

    Kevin

Sign In or Register to comment.