Display modal with row data - without responsive

Display modal with row data - without responsive

TronikTronik Posts: 122Questions: 28Answers: 1

Hi,

Is it possible to use the modal function as shown in https://datatables.net/extensions/responsive/examples/display-types/modal.html without using the responsive plugin?

I can of course include the responsive js files.

For example something like

$('#table').on('click', 'td a', function(){
 
$.fn.dataTable.Responsive.display.modal();

});

Answers

  • TronikTronik Posts: 122Questions: 28Answers: 1
    edited September 2019

    Im also trying to get Sliding child rows but that dont seem to work with fixedColumns?

    Any help getting that to work would me very appreciated

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Hi,

    The modal used by Responsive is really just a styled div. This is the Javascript for it and this is the CSS.

    If all you want is that effect, don't use the whole library since that would be a waste of bandwidth and clock cycles. Instead use that code as the basis for a small custom function.

    Im also trying to get Sliding child rows but that dont seem to work with fixedColumns?

    No sorry. Child rows do not work with FixedColumns at all.

    Allan

  • TronikTronik Posts: 122Questions: 28Answers: 1

    Hi allan,

    Thanks!

    I will test using the modal, but I actually got sliding child rows to "work" in that meaning I disable FixedColumns if the user is browsing from Mobile.

    In desktop i dont need expandable rows since I use FixedColumns.

    Maybe not the prettiest solution but...

    if( !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera 
    Mini/i.test(navigator.userAgent) ) {
    
    new $.fn.dataTable.FixedColumns( table, {
    
            leftColumns: 3
      
       } );
    }
    
This discussion has been closed.