Disable parent click to hide child info : Responsive
Disable parent click to hide child info : Responsive
alamgira
Posts: 4Questions: 1Answers: 0
I have a responsive datatable which shows child info when it loads up and I need to disable child toggle when parent is clicked. Is there any configuration that i can override or a workaround to do this?
I have this so far
var table = $('#LobbyTable').DataTable({
deferRender : true,
scrollY: 450,
scrollX: false,
scroller:true,
loadingIndicator : true,
language: {
search:"",
searchPlaceholder:"Search Contest"
},
aaSorting: [],
responsive: {
details: {
display: $.fn.dataTable.Responsive.display.childRowImmediate,
type: ''
}
},
select : {
info : false
}
});
$($.fn.dataTable.tables(true)).DataTable().columns.adjust().responsive.recalc();
This discussion has been closed.
Answers
Just to check my understanding - you want to allow a single click to show the details, but disable the click from then hiding them?
If so, there is no built in option for that. You could possibly use a custom display renderer (
responsive.details.renderer
) to do that, just add the logic to not hide the child row, but it wasn't designed to operate in that way.Allan
display: $.fn.dataTable.Responsive.display.childRowImmediate, this function is already showing my child which is great. I dont want user to click parent row to expand/collapse child row. Is there any way that i can override the parent click or disable it completely?
I tried this, but it doesn't work
Thanks for the additional information.
Its a bit of a workaround, but you could put the show / hide button into its own column and then hide that column (
columns.visible
), so the end user can't activate it.Otherwise you'd need to modify the Responsive library to do what you need.
Allan
Thank you so much, finally it is working.