How do I add parameter when I have to use var table = for an option

How do I add parameter when I have to use var table = for an option

nandernander Posts: 13Questions: 6Answers: 0
edited October 2022 in Free community support

How do I add parameter when I have to use var table = for an option but the other options done need it Ex:

                       $(document).ready(function () {
            var table = $('#example').DataTable(
            { language: {
                          searchPlaceholder: "Search records",
                          search: ""},
                      fixedHeader: true,
                         // Enable the vertical scrolling
                        // of data in DataTable to 200px
                        scrollY: '600',
            scroller: true,
                        lengthMenu: [ [50, 100, 150, -1], [50, 100, 150, "All"] ],

                        $('#example tbody').on('click', 'tr', function () {
                        if ($(this).hasClass('selected')) {
                        $(this).removeClass('selected');
                        } else {
                        table.$('tr.selected').removeClass('selected');
                        $(this).addClass('selected');
        }
    });
 
                        $('#button').click(function () {
                        table.row('.selected').remove().draw(false);
                

  });

    });

Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide

Answers

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    Sorry, I'm not clear what you are asking for. Please provide more details.

    Kevin

Sign In or Register to comment.