• Resolved winterstreet

    (@winterstreet)


    I’m guessing this isn’t possible, but just checking. Data is coming in from a Google Sheet. Any way to have the data sort on one of the columns for the initial display? Love the plugin, super handy.

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

    (@meitar)

    Use the datatables_order attribute, which maps to order option.

    Thread Starter winterstreet

    (@winterstreet)

    This might be beyond me, not sure yet. Is this something I’d add to the shortcode somehow or to my functions file? (I’m not a developer)

    I was also searching for this option and upon reading Meitar’s reply I tried this:

    {
        "searching": false,
        "paging": false,
        "order": [[ 2, 'asc' ]]
    }

    as my DataTables defaults object. But the object won’t work once I add the “order” option. Did I do it wrongly?

    Thread Starter winterstreet

    (@winterstreet)

    @mauinsons is that going in your functions.php file?

    @winterstreet it’s under Settings -> Inline Google Spreadsheet Viewer

    in the “DataTables defaults object” text field.

    it works fine with

    {
        "searching": false,
        "paging": false,
        "order": [[ 2, 'asc' ]]
    }

    but not

    {
        "searching": false,
        "paging": false,
        "order": [[ 2, 'asc' ]]
    }

    so I’m wondering where I can place the “order” code at

    Plugin Author Meitar

    (@meitar)

    JSON requires strings be double-quoted. Not 'asc' but rather "asc".

    Thread Starter winterstreet

    (@winterstreet)

    Thanks answers my question too, somehow missed the settings page, sorry for the trouble.

    @meitar, thank you so much, it’s now working. appreciate your time on helping me out in this

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Pre-Sort Data’ is closed to new replies.