DataTables 1.10.8 - Buttons 1.0.0 - ColVis
DataTables 1.10.8 - Buttons 1.0.0 - ColVis
AtampizMiguel
Posts: 5Questions: 1Answers: 0
Hi,
how i can set a Callback in Colvis? i created a custom colvis for this function but i dont like this.
I can set a callback when after render colvis? or before?
Tnx and sorry for my bad english.
This discussion has been closed.
Replies
maybe just use somethign like the draw() function
Just listen for the
column-visibility
event.Allan
Ok, and when i press button excel example? when its proccess in build excel?
There is no callback or event for that. If you want that functionality you would need to define your own action for the button or attach your own event listener to it.
Allan
I'm trying datatables Editor 1.5, with 1.01 Buttons and Select 1.0.1. I need to modify the fields when exporting to .txt, but I can not do it fnCellRender. I'm not using TableTools because it was replaced by Buttons and Select. This is my code:
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor },
{ extend: "colvis", collectionLayout: "fixed two-column"},
{ extend: 'csv', fieldSeparator: "", extension: '.txt', header: false, text: 'Exportar',
fnCellRender: function ( sValue, iColumn) {
if ( iColumn === 1 ) {
return sValue +" TableTools";
}
return sValue;
},
exportOptions: {
columns: [0,1,2 ]
}}
]
I exported good, but does not change my spine.
Appreciate give me a help, I can not fix it.
Excuse my English, I use a translator.
Best regards
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.Allan
Allan, tnx for your help, but, i need a "loading image" when the user press any button, example ,print view, export excel, etc.
Any idea?
You'd need to add a custom event handler to the button or modify the library.
Allan
Thanks Allan, but I still can not change the format, you would not have a small example, I'm testing within exportOtions and not working.
Best regards
I'll put an example together, but it will probably be a few weeks before I can do so due to other commitments.
Allan
I can not fix it. Because no test. This is what I have:
{Extend 'csv' fieldSeparator "" extension '.txt' header: false, text: 'Export'
ExportOptions: {
columns: '3: visIdx'
render: function (data, type, row) {
return data + '1234';
}
}
}
It can be so hard?
Best regards
Please do not cross post - it just means less time for me to create such examples that you are looking for. I haven't had a chance to create an example yet - I will try to do so as soon as I can, but there is a massive support backlog at the moment.
Allan