vscoder
vscoder

Reputation: 1007

How to add message to datatables pagination line

Using jQuery Datatables I would like to add a message to the same line as the pagination or page selector line.

Using the code below I can add a custom message to the top, but is there anyway to move the custom message to the bottom and have it float to the right of the Datatables page selector? I think I need to add bottom somehow, somewhere, but the DataTables documentation is not very helpful.

        $("#tbl_usersearch").dataTable({
            searching: false, info: false, lengthChange: false, "dom": '<"add_message">frtip',
        });
        var add_html =
         '<div id="div_message" class="float_right ">' +
            '<img id="img_success" class="" src="/Content/Icons/success.png" style="height:18px;" />' +
            '<img id="img_warning" class="" src="/Content/Icons/warning.png" style="height:18px;" />' +
            '<span id="lbl_message">Message</span>' +
        '</div>';

        $("div.add_message").html(add_html);

Upvotes: 1

Views: 259

Answers (1)

Gyrocode.com
Gyrocode.com

Reputation: 58890

Change dom option so that <"add_message"> is after t (table), for example:

"dom": 'frti<"add_message">p'

Also apply CSS rules to add_message class if necessary.

See dom option for more information.

Upvotes: 2

Related Questions