SearchPanes not clickable (initially) until ShowAll button is used
SearchPanes not clickable (initially) until ShowAll button is used
Link to test case: https://live.datatables.net/tuwabime/2/
Error messages shown: No errors shown
Description of problem: When data is loaded at some point after the table has been initialized and I click on any of the SearchPane filters, they do not respond.
In my example, I have a button to load data and draw. I also have a rebuildPane() included after the draw.
Before clicking, 3 filters are available and I can click on any of the filters showing and they expand, I can click Show All as well. Looks good.
$("#testUpdate").on("click", function (e) {
var examples_table = $('#example').DataTable().clear().rows.add(thisData).order([]).draw();
$('#example').DataTable().searchPanes.rebuildPane();
});
After clicking the 'Update' button, the data loads and the table is drawn. No issue. The rebuildPane() is needed to add the column render for 'Users' to the specified filter. Now all 4 filters appear as expected.
At this point if I attempt to click on any of the filters they do NOT expand. I must click 'Show All first'. After clicking 'Show All' I can click 'Collapse All'. Now all 4 filters are clickable and expand when clicked.
Am I missing something when rebuilding the SearchPanes?
This question has accepted answers - jump to:
Answers
*** Politely bumping ***
If something was not clear please let me know. I believe something is off or not accounted for when rebuilding the searchPanes. Or it's a bug, but I don't want to say that it is until other problems have been eliminated.
*** Politely bumping ***
Also interested in knowing how I can get the "Users" in the SearchPanes to appear like the other 3 SearchPanes before the data is loaded. It's kind of odd to see it not there then suddenly it appears and the SearchPanes adjust across top.
Thank you for your consideration and any assistance you can provide.
I just tried this and it appears to be working as expected for me.
I did the following:
Are these steps correct, or am I missing something?
Colin
@colin Following the steps you are doing fails at step 4. Clicking App Type at that point does not expand. But to be clear I am clicking the input field of "App Type", not the down caret.
Before clicking update, the down caret does expand. Clicking the input field will also expand. They both work.
After clicking update, the down caret does expand. Clicking the input field does NOT expand. Only the caret works.
This is exactly what I am doing to recreate:
I'm using Chrome 116.0.5845.97 and Edge 115.0.1901.203 on Windows 10.
Ah yep, got it, I missed the bit about the
input
element getting focus. To be clear, this is how to reproduce:I've raised it internally (DD-2684 for my reference) and we'll report back here when there's an update.
Colin
@Colin, can you tell in that same link if it is possible to "force" show the pane for Users? The other 3 load before you click the update button.
If I don't use the render, it appears. When I have the render in place, which is needed, it does not appear.
It's an effect of having the definitions of both
columns
andcolumnDefs
together - you only need one, and for you, because of the named columns you could move all thecolumnDefs
options intocolumns
. Doing that withcolumns.searchPanes.shows
does display theUsers
column as required : https://live.datatables.net/tuwabime/7/editColin
@Colin That is just awesome! I really appreciate the time to show that.