sDom not working to suppress page info text

sDom not working to suppress page info text

grahampcharlesgrahampcharles Posts: 20Questions: 1Answers: 0
edited January 2013 in DataTables 1.9
Using 1.9.2. I have a table started with:

[code]
oTable = $("#results-table").dataTable({
"bJQueryUI" : true,
"iDisplayLength" : 15,
"sDom:" : '<"H"r>t<"F">',
"bLengthChange": false,
...
[/code]

As I understand it, that should suppress the "Showing 1 to 3 of 3 entries (filtered from 50 total entries)" text, but it's nonetheless present. The search box is present, too.

Am I missing something about how sDom works?

Code is at http://pancake.io/10dbb7/wishlist.html if you're interested; click one of the categories to view the table.

g.

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,450 Site admin
    Thank you for linking to a test case.

    However, when I click on one of the tabs, I just get an error: `wishlist.js:130TypeError: 'null' is not an object (evaluating 'currentWishlist.indexOf')` .

    My guess is that you are initialising the DataTable with just a plain `$().dataTable()` call, before you then call it with your initialisation options set - the warning 'cannot reinitialise table' alert sort of indicates that this is the case.

    Allan
  • grahampcharlesgrahampcharles Posts: 20Questions: 1Answers: 0
    You must have caught me in the middle of an edit, but it works fine now. In any case, no, I don't repeat the .dataTable() call -- I've verified in the console and with an alert that .dataTable only runs once. (I also don't get the 'cannot reinitialise' error you mention -- was that on a different question?)

    The initialization code is exactly as I pasted it (or fully available at http://pancake.io/10dbb7/scripts/wishlist.js ).

    Does it make a difference that the element is hidden when .dataTable() is called? Only I tried showing it first and the problem persists. Maybe my sDom is invalid? Though I've tried pasting your demo versions...

    Can't find what I'm doing wrong...
  • allanallan Posts: 63,389Questions: 1Answers: 10,450 Site admin
    I still get the same error I'm afraid.

    1. Load the link
    2. Click on the 'Everything' button
    3. Alert saying "init table"
    4. JS error

    5. Click on "Kids Corner"
    6. Alert saying "init table"
    7. DataTables re-init warning
  • grahampcharlesgrahampcharles Posts: 20Questions: 1Answers: 0
    Argh, you're right. Bug that only cropped up when a certain cookie is missing.

    Get that donation link back up, 'cause I owe you a beer.

    Sorry!
  • grahampcharlesgrahampcharles Posts: 20Questions: 1Answers: 0
    Ah, I take that back (except for the beer part). I fixed the bug, .dataTable() is only being called once, but I still see the "Search" box and the "Showing 1 to 10" text with the sDom setting of '<"H"r>t<"F">'.

    g.
  • allanallan Posts: 63,389Questions: 1Answers: 10,450 Site admin
    > "sDom:": "<\"H\"r>t<\"F\">",

    You've got a spare colon in `sDom:` ... :-)

    Allan
  • grahampcharlesgrahampcharles Posts: 20Questions: 1Answers: 0
    Sigh. Of course I do.

    Gar, thanks.

    g.
This discussion has been closed.