Custom Buttons between colvis and Search buttons

Custom Buttons between colvis and Search buttons

geebeetoogeebeetoo Posts: 26Questions: 6Answers: 0

How can I add a series of checkboxes between the Buttons and Search.
See image below:

This question has an accepted answers - jump to answer

Answers

  • arcanisgkarcanisgk Posts: 41Questions: 12Answers: 0

    wich css api are you using to deploy checkboxes????

  • arcanisgkarcanisgk Posts: 41Questions: 12Answers: 0

    ok all you need is declare the area in doom:

    $(document).ready(function() {
        $('#example').DataTable( {
            "dom": '<"toolbar">frtip'
        } );
        //Add your Checkboxs
        $("div.toolbar").html(
        '<label><input type="checkbox" name="cbox1" value="first_checkbox"> All</label>'+
        '<label><input type="checkbox" name="cbox2" value="second_checkbox"> Este es SU</label>'+
        '<label><input type="checkbox" name="cbox2" value="thirt_checkbox"> Regular</label>'
        );
    } );
    
  • geebeetoogeebeetoo Posts: 26Questions: 6Answers: 0
    edited May 2020

    @arcanisgk This does not work as it actually replaces the Excel, PDF and Show Hide Columns with my check boxes. I need to include everything and put the custom checkboxes in the middle as per the image above.
    THE IMAGE BELOW SHOWS THE WRONG WAY

  • kthorngrenkthorngren Posts: 21,382Questions: 26Answers: 4,959
    Answer ✓

    Did you add the B to the DOM option? Unless you are doing it a different way you need to follow the Display Buttons doc and do something like this:
    `"dom": 'B<"toolbar">frtip'

    If this doesn't help then post a link to your page or a test case so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • geebeetoogeebeetoo Posts: 26Questions: 6Answers: 0
    edited May 2020

    Kevin, That helped. Now I just need to figure how to place it exactly between the Buttons and the Search box. Currently with your solution it displays below the Excel,PDF buttons.

  • arcanisgkarcanisgk Posts: 41Questions: 12Answers: 0

    @geebeetoo this is that you need i think but you need work more on learn how to post:

    live.datatables.net/yiwacide/1/edit?html,css,js,output

This discussion has been closed.