Export Check Box value using DataTables 1.10.9 and Buttons
Export Check Box value using DataTables 1.10.9 and Buttons
nguyen220
Posts: 3Questions: 2Answers: 0
Is there any examples on how to export the data of a checkbox. I'm using the buttons feature of DataTables 1.10.9 and the field that contains the check box value is always blank.
This discussion has been closed.
Answers
Exporting the table doesnt export the values of inputs, it exports the values within the table, and will strip HTML (by default). I recommend just adding some functionality to export a certain value based on if the checkbox is checked or not.
If you want to custom format the text for the exported data, you need to use the
orthogonal
option of thebuttons.exportData()
method (which you can set using theexportOptions
option for the button you are working with (e.g.excelHtml5
).That uses DataTables' orthogonal data abilities - so you would need to define a
columns.render
option for the column you want to customise the data export for, and give it a function that will handle the orthogonal data you want to export.Thanks. However how do you do it where you don't know what field has the checkbox? I'm writing an app that pulls all stored procedures (sproc) (~100+) from a database and list it in a listbox. The user selects from the list and executes the sproc. not know which sproc was selected or even if it has a checkbox or not has me stumped on how to handle it.