Trying to add rows and col-sms to the pagination and search

Trying to add rows and col-sms to the pagination and search

crayvoccrayvoc Posts: 3Questions: 1Answers: 0

Hi,

I'm trying to get a class="row" and a class="col-sm-12 around the pagination and search box, it's working in dataTables but the same code won't work if I use editor.

$.extend( true, $.fn.dataTable.defaults, {
    "sDom": "<'row'<'col-sm-12'<'pull-right'f><'pull-left'l>r<'clearfix'>>>t<'row'<'col-sm-12'<'pull-left'i><'pull-right'p><'clearfix'>>>",
    "sPaginationType": "bs_normal",
    "oLanguage": {
        "sLengthMenu": "Show _MENU_ Rows",
        "sSearch": ""
    }
} );

Right now it looks like this but the sDom code isn't affecting anything at all? :(

Answers

  • crayvoccrayvoc Posts: 3Questions: 1Answers: 0

    Looks like I was trying to do deprecated stuff (I think.. not sure :>)

    It works like this at the initialization:

        $('#example').dataTable( {
            "dom": "<'row'<'col-sm-12'<'pull-right'f><'pull-left'T>r<'clearfix'>>>t<'row'<'col-sm-12'<'pull-left'i><'pull-right'p><'clearfix'>>>",
            "ajax": "php/example.php",
            "columns": [
                {
                    "data": "id"
                },
                {
                    "data": "name"
                },
                {
                    "data": "created"
                }
            ],
            "tableTools": {
                "sRowSelect": "os",
                "aButtons": [
                    { "sExtends": "editor_create", "editor": editor },
                    { "sExtends": "editor_edit",   "editor": editor },
                    { "sExtends": "editor_remove", "editor": editor }
                ]
            }
        } );
    
This discussion has been closed.