Column visibility with page length option

Column visibility with page length option

PaulFreeWebsPaulFreeWebs Posts: 63Questions: 4Answers: 1

I want to have both these options display, but I can only make one show, I have tried changing
"dom": 'Bfrtip' to "ldom": 'Bfrtip'" but this still wont work, here is the whole code I have used

$(document).ready(function() {
        $('#powers').DataTable( {
            "dom": 'Bfrtip',
            "buttons": [
                {
                    "extend": 'colvis',
                    "collectionLayout": 'fixed two-column',
                    "postfixButtons": [ 'colvisRestore' ]
                }
            ],
            "columnDefs": [
                {
                    "targets": -1,
                    "visible": false
                }
            ],
            "select": 'multi',
            "iDisplayLength": 100,
            "aLengthMenu": [[ 50, 100, 200, 300, 400, -1], [50, 100, 200, 300, 400, "All"]],
            "bsort": false,
            "scrollY": 800,
            "stateSave": true,
            "stateDuration": 0,
            "oLanguage": {
                "sEmptyTable": "No Powers To Display",
                "sZeroRecords": "The power you entered has not been found",
                "sPaginationType": "full_numbers",
                "sLengthMenu": " _MENU_ Powers per page",
                "sProcessing": "DataTables is currently busy",
                "sInfo": "Got a total of _TOTAL_ entries to show (_START_ to _END_)   "
            }
        } );

    } );

thanks in advanced

Replies

  • allanallan Posts: 63,704Questions: 1Answers: 10,502 Site admin

    I have tried changing "dom": 'Bfrtip' to "ldom": 'Bfrtip'" but this still wont work

    There is no ldom option. The property name is dom as the documentation notes.

    If you want the length parameter to show, add the l to the string value (the right hand side).

    I would suggest reading through the dom documentation which explains at length how that option operates.

    Allan

  • PaulFreeWebsPaulFreeWebs Posts: 63Questions: 4Answers: 1

    Oh, thats how you do it, I have read though the dom options but cant see if there is a center option, as wanted to make http://prntscr.com/88mxs5 next to each other

  • allanallan Posts: 63,704Questions: 1Answers: 10,502 Site admin

    No - the dom option is entirely about the order of the DOM elements. For visual alignment you need to use CSS.

    Allan

  • PaulFreeWebsPaulFreeWebs Posts: 63Questions: 4Answers: 1

    ok, thanks for the reply, maybe a update in the future to allow this?

  • allanallan Posts: 63,704Questions: 1Answers: 10,502 Site admin

    I do plan some limited layout support in future, but really it is a solved problem through CSS already.

    Allan

This discussion has been closed.