Add Custom Column

Add Custom Column

dtw11dtw11 Posts: 18Questions: 4Answers: 0

How can I add a customer column with glyphs? I am pulling in an array from a db connection and using the columns: parameter when rendering the table object. Thanks

Answers

  • dtw11dtw11 Posts: 18Questions: 4Answers: 0

    I resolved with <th>Edit/Delete</th>. Then when creating my data array I added the column with a custom value. Then added the custom column name to the data object when generating the rows.

  • rgrg Posts: 4Questions: 1Answers: 0

    I presume you are using Editor here. You could use editor.add() method documentation at this link here - https://editor.datatables.net/reference/api/

  • dtw11dtw11 Posts: 18Questions: 4Answers: 0

    No I can not use Editor since it costs as I understand it.

  • allanallan Posts: 61,644Questions: 1Answers: 10,093 Site admin

    Yes - Editor is commercial software.

    However, you might still find this example to be useful (focus only on the DataTables aspect if you don't want Editor). Specifically it uses columns.defaultContent to show the Edit/Delete links in each row. You could easily use icons for that instead and bind an event handler to them.

    Allan

This discussion has been closed.