When I add a row, it popup warning

When I add a row, it popup warning

knvbknvb Posts: 4Questions: 1Answers: 0

I am preparing an user management with datatable plugin.
It works fine.
However,I add the attribute data-order="0,1000" to the first column of the first row for keeping the "anonymous" row always on top.
When I click on the upper left hand corner "+" , I got a warning message in the .png file of attachment.
How can I fix the problem?
I attached a zip file for your reference.
All related files are stored in the zip file.

Replies

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

    The problem is that you are adding data to the table in a different format from that which DataTables has automatic read the data in from the HTML as. Using the data-order attribute means that you need to provide two data points for that column. This is the structure to use:

      userTable.row
        .add([
          {
            "@data-order": "10000",
            "display": '<input type="text">'
          },
          "<input type=text>",
          "&#x271A;",
          "<input type=checkbox>",
          "&#x2796;"
        ])
    

    Allan

This discussion has been closed.