How to add Table title between search and remove button

How to add Table title between search and remove button

rajsirrajsir Posts: 10Questions: 0Answers: 0
edited August 2011 in General
Hi All-

I am wondering how can I add a title to my table between remove and search something like "[data table : employee info]" ???

tried sDOM : settings but it removing the show entries and add and remove buttons.... I am learning n dont know much.

Thanks a lot.

Replies

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    DataTables doesn't have a remove button by default, so there must already be a plug-in or some DOM customisation which is adding that in. Have a look at this demo for how to add things in using sDom: http://datatables.net/release-datatables/examples/advanced_init/dom_toolbar.html .

    Allan
  • rajsirrajsir Posts: 10Questions: 0Answers: 0
    Hi Allan -
    When I add this piece of code... nothing worked for me....
    [code]$(document).ready(function() {
    $('#example').dataTable( {
    "sDom": '<"toolbar">frtip'
    } );
    $("div.toolbar").html('Custom tool bar! Text/images etc.');
    } );
    [/code]


    my code is something like this...
    [code]











    $(document).ready( function () {
    var id;//simulation of id
    $('#myDataTable').dataTable({
    "bServerSide": true,
    "sAjaxSource": "processor?action=select&table=acctrollups",
    "bProcessing": true,
    "sPaginationType": "full_numbers",
    "bJQueryUI": true ,
    "aoColumns": [
    {
    "bVisible":false
    },
    {
    cssclass: "required",
    indicator: 'Saving...',
    tooltip: 'Click to edit',
    onblur: 'submit',

    },
    {
    cssclass: "required",
    indicator: 'Saving...',
    tooltip: 'Click to edit',
    onblur: 'submit',

    }]
    }).makeEditable({
    sUpdateURL: "processor?action=update&table=acctrollups",
    sUpdateHttpMethod: "POST",
    sAddURL: "processor?action=new&table=acctrollups",
    sAddHttpMethod: "POST",
    sDeleteHttpMethod: "POST",
    sDeleteURL: "processor?action=delete&table=acctrollups",
    sAddNewRowFormId: "formAddNewRow",
    oAddNewRowButtonOptions: { label: "Add", icons: {primary:'ui-icon-plus'}},
    oDeleteRowButtonOptions: { label: "Remove", icons: {primary:'ui-icon-trash'}},
    oAddNewRowFormOptions: {
    title: 'Add New Parent Child Account Mappings',
    show: "blind",
    hide: "explode",
    modal: true} ,
    sAddDeleteToolbarSelector: ".dataTables_length"});

    // $("div.toolbar").html('Custom tool bar! Text/images etc.');
    // "sDom": '<"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix">',

    } );

    [/code]
This discussion has been closed.