Datatables - Responsive Row Trigger
Datatables - Responsive Row Trigger
https://datatables.net/reference/event/responsive-display
I'm having a issue where the ajax reload function is causing the datatables responsive plugin to close the open row details.
table.ajax.reload( null, false );
I'm aware of a workaround for select2 fields by listening for the ajax request (below) and I am confident I'll have to use this approach with this issue.
table.on('xhr.select2Fix', function(){
My question is can I trigger the responsive plugin to open a row ID manually (for my problem here I can simply record the rowID on this event)
table.on( 'responsive-display', function ( e, datatable, row, showHide, update ) {
or do I only have the option of using the button beside the row to toggle the expansion/retraction of the responsive display?
This question has an accepted answers - jump to answer
Answers
If you rows have an id (
rowId
) then Responsive should automatically keep the rows that are open in that state after a reload. If that isn't working for you, I'd need a link to a test case.Allan
I've Pm'd you a link and credentials.
Thanks! Could you update the DataTables libraries on the page (e.g. DataTables to 1.10.13, Responsive to 2.1.1, etc)? If that doesn't solve it out right, could you use the debug version of the software please, so I can put break points in it without needing to parse the minified contents .
Allan
Sure thing! I've updated the code to use the latest version. It seems to still be happening.
I've also ensured the debug version is being used to assist in your efforts!!
Allan,
Let me know if you're having any issues and I'll be glad to assist!
Sorry for the delay! Its next on my list for tomorrow morning.
Allan
Just a reminder message
Thanks. Finally got it. Looks like you are using an old version of Responsive. 2.1.1 is the current release, which adds this specific feature (release notes) but your site is using 2.1.0.
It appears that I hadn't updated the download builder for the 2.1.1 release. I have down now.
Allan