searchBuilder.columns not working with dom: 'Bfrtip'?
searchBuilder.columns not working with dom: 'Bfrtip'?
straetch
Posts: 5Questions: 3Answers: 0
My first forum question.
Code with dom: 'Bfrtip',
searchBuilder: {
columns: [3,4,5]
},
Everything works fine, except the modal shows all columns in the Data drop-down.
As an experiment I replaced dom: 'Bfrtip' by dom: 'Qlfrtip' ; now only the three columns are displayed, as expected.
This question has an accepted answers - jump to answer
Answers
If you are not using
dom: 'Qlfrtip'
how are you initializing SearchBuilder?This test case shows using the above code with API initialization and it limits to the columns specified:
http://live.datatables.net/girajobe/1/edit
Please provide a link to your page or update the test case to show the issue.
Kevin
My JQuery skills are limited. I made my code by assembling code snippits from the excellent examples and the forum posts.
This was a section of my code with a button to activate searchBuilder:
SearchBuilder was fully operational except for the Data drop-down list that listed all columns. (with dom: 'Qlfrtip' that also works, but is then not button-driven).
I dug deeper in the examples and found this:
This works.
The direct relationship between a button definition and the Data dropdown is unclear to me.
The
searchBuilder
button type creates its own instance of SearchBuilder - you need to pass any configuration options you want for it to itsconfig
option.That and the
searchBuilder
options are really just short hand ways of sayingnew DataTable.SearchBuilder(table, options);
.Allan