Disable paging,ordering,info,search properties along with column definition

Disable paging,ordering,info,search properties along with column definition

mahdiyar11mahdiyar11 Posts: 2Questions: 1Answers: 0
edited February 2020 in Free community support

hello
i want to Disable paging,ordering,info,search properties along with column definition like this

<script>
$(document).ready(function() {
    var table = $('#stb1').DataTable({
        "paging":   false,
        "ordering": false,
        "info":     false,
        "search":   false } );
        
        table.columns: [
            { "data": "Qty" },
            { "data": "Des" },
            { "data": "Price"},
            { "data": "Payable" }]
    
    }); 
</script>

how can i do?

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

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,344Questions: 26Answers: 4,954
    Answer ✓

    Put all the config options in one initializations code, like this:

    <script>
    $(document).ready(function() {
        var table = $('#stb1').DataTable({
            "paging":   false,
            "ordering": false,
            "info":     false,
            "search":   false,
             
            columns: [
                { "data": "Qty" },
                { "data": "Des" },
                { "data": "Price"},
                { "data": "Payable" }]
         } );
        });
    </script>
    

    Kevin

  • mahdiyar11mahdiyar11 Posts: 2Questions: 1Answers: 0
    edited March 2020
    <script>
    $(document).ready(function() {
        var table = $('#stb1').DataTable({
            "paging":   false,
            "ordering": false,
            "info":     false,
            "searching":   false,
              
            columns: [
                { "data": "Qty" },
                { "data": "Des" },
                { "data": "Price"},
                { "data": "Payable" }]
         } );
        });
    </script>
    

    thas ok but searching is correct . thank you

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

This discussion has been closed.