How to add multiple values to sDom?

How to add multiple values to sDom?

rpanditrpandit Posts: 14Questions: 0Answers: 0
edited March 2014 in General
I need to show pagination on both top and bottom of the datatable which i am doing using <"top"lfip>rt<"bottom"ip<"clear">. I also want to show disclaimer message on top of the datatable which i was doing using lfr<"delete-disclaimer">tip. My question is how can i have both in sDom?

"sDom": 'lfr<"delete-disclaimer">tip,<"top"lfip>rt<"bottom"ip<"clear">' is not working.

Replies

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    You would just use:

    [code]
    <"top"lfip<"delete-disclaimer">>rt<"bottom"ip<"clear">
    [/code]

    I think.

    Allan
  • rpanditrpandit Posts: 14Questions: 0Answers: 0
    Thanks, that worked..
  • NewProgrammerNewProgrammer Posts: 4Questions: 0Answers: 0
    can you please more elaborate how to add multiple values to sDom
    with these followings
    1) "sDom": 'C<"clear">lfrtip'
    2) "sDom": 'T<"clear">lfrtip'
    3) "sDom": "Rlfrtip"
    4) "sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    Each character in sDom is a feature - unless it is in quotes. It is that simple! If you want TableTools, just add `T` . If you want ColVis add `C` . If you want both, add both!

    Allan
  • NewProgrammerNewProgrammer Posts: 4Questions: 0Answers: 0
    edited March 2014
    will it be Comma-separated ???

    like "sDom": "C,T" ???


    or can u please mention one example please ?
  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    No - it is not comma separated. There is nothing in the documentation suggesting that it is - at least there shouldn't be. If there is, could you point it out to me so I can remove it.

    As I say, each character is a feature - just add them. So if you want ColVis and TableTools add 'CT'. It is that simple.

    Allan
  • NewProgrammerNewProgrammer Posts: 4Questions: 0Answers: 0
    not working , may be i am wrong somewhere

    here is my example

    var oTable = $('#example').dataTable( {
    "sDom": "<'row'<'fLft'l><'fRgh'f>r>t<'row'<'fLft'i><'fRgh'p>>CTW",
    "sDom": 'W<"clear">lfrtip',
    "sPaginationType": "bootstrap",
    "oLanguage": {
    "sLengthMenu": "_MENU_ records per page"
    },
    "sAjaxSource": "js/objects_subarrays.txt",
    "aoColumns": [
    { "mData": "engine", "sTitle": "Engine" },
    { "mData": "browser", "sTitle": "Browser" },
    { "mData": "platform", "sTitle": "Platform" },
    { "mData": "details.0", "sTitle": "Details .0" },
    { "mData": "details.1" , "sTitle": "Details .1" }
    ]
    } );

    how can i include ColVis and TableTools it ???
    have i mentioned correctly ???
  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    You can only have one sDom. In your case, the second one overwrites the first.
  • NewProgrammerNewProgrammer Posts: 4Questions: 0Answers: 0
    var oTable = $('#example').dataTable( {
    "sDom": "<'row'<'fLft'l><'fRgh'f>r>t<'row'<'fLft'i><'fRgh'p>>CTW",
    "sPaginationType": "bootstrap",
    "oLanguage": {
    "sLengthMenu": "_MENU_ records per page"
    },
    "sAjaxSource": "js/objects_subarrays.txt",
    "aoColumns": [
    { "mData": "engine", "sTitle": "Engine" },
    { "mData": "browser", "sTitle": "Browser" },
    { "mData": "platform", "sTitle": "Platform" },
    { "mData": "details.0", "sTitle": "Details .0" },
    { "mData": "details.1" , "sTitle": "Details .1" }
    ]
    } );

    in this case even

    CTW not working

    is it right order ?
  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    That looks like it should work. Please link to a test case showing the problem so we can debug it.

    Allan
This discussion has been closed.