On row select open responsive modal
On row select open responsive modal
mattdykstra
Posts: 3Questions: 2Answers: 0
Hi,
Can I open the responsive modal from SELECT row when not in responsive view?
live.datatables.net/jaxecidu/1/edit
$(document).ready( function () {
var table = $('#example').DataTable({
select: true,
responsive: {
details: {
type: 'column',
target: 'tr', //THIS WORKS GREAT IN RESPONSIVE VIEW
display: $.fn.dataTable.Responsive.display.modal( {
header: function ( row ) {
var data = row.data();
return 'Details for '+data[0]+' '+data[1];
}
}),
renderer: $.fn.dataTable.Responsive.renderer.tableAll( {
tableClass: 'table'
})
}
}
}).on( 'select', function ( e, dt, type, indexes ) {
//if not responsive view launch responsive modal
});
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
This is modal
In Script Add this
I was actualy after the built in responsive Modal $.fn.dataTable.Responsive.display.modal
https://datatables.net/reference/option/responsive.details.display
Listen for the
responsive-resize
event and then trigger aclick
event on the row.Allan
@allan - could you cite an example of code? For select to be responsive way, click (highlighted select status) has to convey a row or selected data identifier as well. Ideally a chart.js script could be listening and respond to the selected row - in the case of a dashboard.