• Resolved Torvon

    (@torvon)


    Thx for the fantastic plugin and your support here.

    My goal: to suppress all header buttons but keep the ability to sort alphabetically.

    Trying to adjust the header of my table, but having issue to understand what
    datatables_dom does and what the options are. Been trying to read up (you link to https://datatables.net/reference/option/) but I cannot find _dom there, just dom and that seems something entirely different.

    What I tried?

    When I type
    datatables_dom=”false”
    all buttons disappear but so does the ability to sort. Also, it seems to do datatables_auto_width=”true”
    as well because with datatables_dom=”false” all columns fit while they don’t fit without this argument. Further, FixedHeader=”true” isn’t working for me.

    Thx for your help!
    Torvon

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Meitar

    (@meitar)

    I think you’re looking for https://datatables.net/reference/option/dom ??

    Thread Starter Torvon

    (@torvon)

    Yes, as I said above: “I cannot find _dom there, just dom and that seems something entirely different.”

    In other words, I have no idea how to use the information provided on the site to disable the buttons but not disable the ability to sort the table.

    Thanks for your help Meitar!

    Plugin Author Meitar

    (@meitar)

    The datatables_dom attribute is the dom option for DataTables. Its value is a string, as described on the page. So datatables_dom="l" means “only show the length input control,” and so on.

    Thread Starter Torvon

    (@torvon)

    Yes, I understand. I’ve looked at dom before posting.

    If I enable any element — be it “l” or “f” or “t” or whatever — I see this element, and additionally I see the arrows to sort things alphabetically.

    What I do not find is an option to *only* enable how to sort things alphabetically. Do you know how I would do that? Thank you

    Plugin Author Meitar

    (@meitar)

    I still don’t really understand what you’re asking, but maybe you’re looking for the columns.orderable property? I still think you’re better off doing some Internet searches with various keywords. This one was linked off several pages that popped up on a search for “datatables sort alphabetically.”

    Thread Starter Torvon

    (@torvon)

    Thanks for helping.

    The table generated from your WordPress plugin comes with a number of buttons. To disable these, I can use

    datatables_dom=”false”

    From the description of dom, I still don’t understand why this is, or why dom has anything to do with the buttons. But ok, it seems to work. I don’t have this from the datatables website, but from a help request on a forum.

    However, datatables_dom=”false” also deactivates the way to order columns. I don’t understand why, and column order is not mention in the dom readme. Given my limited knowledge about javascript, I don’t know what this means, or how I can rectify that.

    Now, https://datatables.net/reference/option/columns.orderable looks great, thanks. However, the language here (I assume java script) is not the one you use for the table layout.

    For instance, the code needed to disable paging is
    datatables_paging=”false”

    but the website you link to says
    $(‘#example’).dataTable( {
    “paging”: false

    In other words, the help you link to provides help in programming language A when I need to write the code in language B. I find that a bit difficult :). So, while I’ve read https://datatables.net/reference/option/columns.orderable but I don’t understand how I can insert that into the code snippet in another programming language.

    datatables_orderable=”true”

    does not work, neither does

    columns_orderable=”true” or

    columns.orderable=”true”

    Thanks again.

    • This reply was modified 8 years, 1 month ago by Torvon.
    Plugin Author Meitar

    (@meitar)

    You’re asking the same questions asked many, many times in this forum before. You should read the plugin’s FAQ page. The headline “How do I change the default settings, like can I turn paging off? Can I change the page length? Can I change the sort order?” is of particular relevance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Questions about table header’ is closed to new replies.