• Resolved Argentum

    (@argentum)


    Hello!
    Sorry if I am asking something terribly obvious, I am probably daft. Can you show the table with the original order of the lines but have the with DataTables sorting still enabled? I tried FixedColumns-left-1 (the left column of two columns is what should be as original spreadsheet). Didn’t work.

    Best regards

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

    (@meitar)

    Thread Starter Argentum

    (@argentum)

    Give me a hint. Do I modify the DataTables defaults object or add it in the shortcode? I’ve read the Datatables reference but I’m not sure how to go about to apply it back in WordPress.

    Plugin Author Meitar

    (@meitar)

    Yes. Either of those will work. Why don’t you try it and see?

    Thread Starter Argentum

    (@argentum)

    Because I am not sure how to do it and spent an hour last night trying to figure out how. Not everybody is as brilliant as you and fluent in the syntax. If you know the answer off the bat why don’t you give me the answer? Who knows. Maybe there are more nitwits out there that would benefit.

    Plugin Author Meitar

    (@meitar)

    From the DataTables documentation linked above:

    No ordering applied by DataTables during initialisation. The rows are shown in the order they are read by DataTables (i.e. the original order from the DOM if DOM sourced, or the array of data if Ajax / data sourced):

    $('#example').dataTable( {
        "order": []
    } );

    From this plugin’s FAQ:

    All of these DataTables options are accessible through shortcode attributes. The shortcode attribute is an underscore-separated version of the DataTables’s CamelCase’ed option name, prefixed with datatables_.

    […]

    Some DataTables options need to be given JavaScript array literals, such as in the case of the DataTables order option, which controls the initial sort order for a table. However, using square brackets ([ and ]) inside a shortcode confuses the WordPress parser, so these characters must be URL-escaped (into %5B and %5D, respectively).

    So step one, use a shortcode that starts with datatables_

    Step two, choose the DataTables configuration option you want, which if you read the DataTables docs or even if you didn’t after I linked you to it above you know is: order

    Step three, set attribute to the value you want, the empty array, URL-encoded as per the FAQ: ="%5B%5D"

    datatables_order="%5B%5D"

    I didn’t know this off the bat. I (re-)read the DataTables docs and the FAQ. That’s. What. They’re. There. For.

    As for why I don’t just spit out answers, it is because I would rather live in and work towards making a world where people are capable of reading and experimenting than one in which they are given answers by authorities that they do not understand, even if that authority is me. What’s your excuse?

    Thread Starter Argentum

    (@argentum)

    Wheee! Works. ??

    I beg forgiveness for my harsh words. I was under the impression that you knew, and took some cruel pleasure in rubbing my ignorant nose in it saying RTFM.

    I have no other excuse than that I am a bit thick in the head sometimes reading syntax in a programming language I don’t master written in a language which is not my native one. That is the sad truth.

    Big thanks for the help. I will donate to your plugin.
    Peace
    A

    • This reply was modified 7 years, 8 months ago by Argentum.
    Thread Starter Argentum

    (@argentum)

    Just one more question, and this one I think you want to answer, why is the Paypal link to a Chinese Paypal page? I don’t read Chinese very well either.

    Plugin Author Meitar

    (@meitar)

    why is the Paypal link to a Chinese Paypal page?

    It’s not.

    Maybe PayPal is localizing the text for you based on your location. Maybe your browser is requesting Chinese texts. Or maybe your computer is not sending you to the real PayPal.

    Thread Starter Argentum

    (@argentum)

    I was not the first. Weird. Must stop Ebay ordering tech junk from China I guess.
    https://www.paypal-community.com/t5/Archive/My-Account-Suddenly-Became-Chinese/td-p/838808

    I made a small donation for your valuable support.
    Transaction ID: 9KU94295RP919084L
    A

    Plugin Author Meitar

    (@meitar)

    Thank you. ??

    Thread Starter Argentum

    (@argentum)

    Welcome! ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Keeping original sort with DataTables sorting still enabled’ is closed to new replies.