Hide culumn and select on
Hide culumn and select on
pippuccio76
Posts: 19Questions: 10Answers: 0
Hi sorry for english , i want to extract data from datatable but i have some select field(to change db with ajax) with this code i can simply export the selected text :
var buttonCommon = {
exportOptions: {
format: {
body: function (data, row, column, node) {
// qui le colonne con le select
if (column == 14 || column==15 || column==16 || culumn ==17) {
return $(data).find("option:selected").text()
} else {
return data
}
}
},
}
};
but i want extract some culumn :
buttons: [
//excel esporta tutto
$.extend(
true,
{},
buttonCommon,
{
extend: "excel",
text: 'Esporta tutto Excel',
exportOptions: {
//columns: [ 2,3,4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17 ],
},
modifier: {
selected: null
},
}
}
),
if i decomment //columns: [ 2,3,4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17 ], i have an error and don't work . How can i insert culumn to extract ?
Replies
What is the error?
Please provide more details of what is not working. Better please post a link to your page or a test case replicating the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin