Buttons and Individual column searching
Buttons and Individual column searching

I want to use buttons and Individual column searching (text inputs+select, all in tfoot). I set up buttons, select inputs and text in cols where i want. When i add text inputs, the buttons are gone. How i can use both at same time? Buttons in header and Individual column searching in tfoot?
I use code like in axamples. There is no errors in console. Table is working. When i deleting Individual column searching buttons are visible. I dont want put all my code bacause js file has more than 400 lines (nice table )
// Setup - add a text input to each footer cell
$('#example tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} );
//buttons
buttons: [
{ extend: "create", editor: editor },
{ extend: "edit", editor: editor },
{ extend: "remove", editor: editor },
'colvis', 'print', 'copy', 'excel',
{extend: 'pdf', orientation: 'landscape', pageSize : 'A0',}
]
// Apply the search
this.api().columns().every(function () {
var that = this;
$('input', this.footer()).on('keyup change clear', function () {
if (that.search() !== this.value) {
that
.search(this.value)
.draw();
}
});
});
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
This question has an accepted answers - jump to answer
Answers
Its hard to say from your code snippets. Looks like you could be missing a comma after the
]
on line 14. I'm assuming that you cut out a bunch of code thus not showing the us ofoption initComplete
.Please post a link to your page or a running test case showing the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Thanks for fast answer. Sorry for mistake with Syntax highlighting. Im new
Code is working fine. There is no errors in console. There is logical problem.
When i erase
The buttons reappear
Is there any example with buttons and Individual column searching in one table?
I cant put my code in live.datatables.net, my data for table base on json from mysql. I can put js file in JS bin.
I took this example and added buttons to it here:
http://live.datatables.net/xiyubafi/1/edit
https://datatables.net/examples/api/multi_filter_select.html
The problem you are having is not data specific. You can build an example where you like as long as it shows the issue. In fact you can update mine if you like. Or you can start from this basic Editor example if you also want to show your editor buttons.
http://live.datatables.net/guwafemu/1/edit
Kevin
Ok, i feel stupid
i will check differences betwen my code and your example. Write when i will find issue.
Thank you very much for your help
on your example my code is working
http://live.datatables.net/qajefiwi/1/edit?js,output
ehhh... it will be loooong evening...
it start working
i dont know why
you can close topic