"dt-button-collection" trigger event on hide
"dt-button-collection" trigger event on hide

Is there an event to trigger when it hide?
I need this to redraw tables cause sometimes appear scrolling and header goes no aligned.
Something like this?
$(document).on("hide", ".dt-button-collection", function(event) {
setTimeout(function(){
$.fn.dataTable.tables( {visible: true, api: true} ).columns.adjust().responsive.recalc().draw();
}, 1000);
});
but this doesn't work..
This discussion has been closed.
Replies
Hi @itajackass ,
When you say, "when it hide", do you mean the button collection? I'm surprised that when the collection is closed it affects the scrolling and header alignment. You could try the
autoClose
option as in this example - that may make a difference.I've played around with events and can't get one to trigger when the collection closes, but perhaps you could trigger on the thing that the button does?
Cheers,
Colin
Yes see attachment. It occurs when i've only few row but a lot of columns so dropdown is height and scroller appear inside datatable
Ok i'll try thanks
That is odd. I tried to reproduce it with a table from a different thread without any joy (see here). If you could link to a test page. or modify my example, then we could take a look.
Cheers,
Colin
Yes: here it is. http://live.datatables.net/wivoxoju/1/
Its because the drop down menu is inside the tab container. The tab container must have a fixed or max-height on it, so it isn't automatically resizing (height-wise) to accommodate the drop down.
I'd suggest using the
collectionLayout
option of thecollection
button type, set to betwo-column
to address that (i.e. less height).Allan
@allan & @colin , I too need "dt-button-collection" hide/close event. kindly help me ASAP
This is where an event would need to be added. Daft question, but why do you need to know that?
Allan
Thanks @allan . I need that to track user's activity along with collections