Bug in SearchPanes: Custom panes not shown if using buttons
Bug in SearchPanes: Custom panes not shown if using buttons
pgerundt
Posts: 90Questions: 13Answers: 2
in SearchPanes
Link to test case:
http://live.datatables.net/qiyevima/2/edit
Description of problem:
When using the Buttons extension via option
dom: 'Bfrtip',
the custom pane is not displayed.
When using the 'classic'
dom: 'Pfrtip',
everything is fine...
This discussion has been closed.
Replies
Looks like you are missing
buttons.bootstrap4.min.css
, for example:See this updated example:
http://live.datatables.net/qiyevima/3/edit
Kevin
Hi Kevin,
nope, that doesn't make get custom pane "Age Range" to show up.
I'm still searching in the code for the cause but it looks like that
- when initialized with the "dom" option including "P", the custom panes are stored in
this.customPaneSettings
- but when initialized with the "dom" option having "B" instead,
$.fn.dataTable.ext.buttons.searchPanes.action
or$.fn.dataTable.ext.buttons.searchPanes.init
does not call_paneDeclare()
My guess is there's something wrong around lines 2793+:
I'm getting closer to the bug:
SearchPanes
constructor (line 1580):dom
option havingP
:opts
is setdom
option havingB
instead ofP
:opts
is undefinedMaybe that helps:
lines 2815+:
P
indom
option:settings._searchPanes.s.panes
only contains 'generic' panes, no custom pane(s)B
indom
option:settings._searchPanes.s.panes
contains 'generic' panes PLUS custom pane(s)Hi @pgerundt ,
Thanks for pointing this out. I'm in the middle of exam season at the moment, but will take a look on Friday when I am next working. Hopefully I can get a fix sorted then.
Thanks,
Sandy
Dear Sandy,
thank you very much and good luck with your exams, I'll keep my fingers crossed.
If you can take a look on Friday on this new problem here:
http://live.datatables.net/qiyevima/5/edit
The option
cascadePanes
is also not working when usingB
in thedom
option.But I guess the problem is totally related.
Thanks,
Pascal
Hi @pgerundt ,
I think this will solve both of your issues...
When configuring SearchPanes within a button you need to set the configuration in the buttons config object rather than the generic SearchPanes object. See your updated example here.
Thanks,
Sandy
Hi Sandy,
thank you very much. The JS object trees are sometimes a little bit confusing.
After some sleepless nights, I got everything up and running...
Thank you!