• Resolved eiriktrials

    (@eiriktrials)


    Hi,

    I don’t manage to sort a table. Nothing happen when I add query=”sort by V asc”.

    Am I doing it wrong, or isn’t it possible to sort a table when I’m using the no-datatables option? Should I put some offset in the query too, so I don’t sort the first row?

    Live link: nm.biketrial.no/live/

    I want to sort each of these four tables after the last column (V), and put the row with the lowest number first.

    Thanks!

    https://ww.wp.xz.cn/plugins/inline-google-spreadsheet-viewer/

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

    (@meitar)

    You’re looking for order by, not sort by.

    Thread Starter eiriktrials

    (@eiriktrials)

    Thanks. But, is the shortcode correct now?

    [gdoc key=Qfjk5k5kjg" use_cache="no" class="no-responsive" expire_in="0" class="no-datatables" gid="0" query="order by V asc offset 1"]

    Plugin Author Meitar

    (@meitar)

    Is it working for you? If it’s working, it’s correct. If it’s not working, it’s not correct. Try it and see. 😉

    Thread Starter eiriktrials

    (@eiriktrials)

    Its not working. Thats why Im asking for the help. Nothing happens with any query I try.

    Plugin Author Meitar

    (@meitar)

    Well, for one thing, there is no spreadsheet with that key: https://spreadsheets.google.com/pub?key=Qfjk5k5kjg

    For another, you have two class attributes, but only need one, and no-responsive is implied by no-datatables (because Responsive is a DataTables plugin), so you can simplify it to just class="no-datatables".

    Another issue is that a gid of 0 doesn’t make any sense, so you can just omit that entirely.

    And finally, you are missing a quotation mark in your use of the key‘s attribute value. (key=Qfjk5k5kjg" <– should actually be quoted like key="Qfjk5k5kjg" <– correctly quoted value)

    So, all together, that means you probably want something more like:

    [gdoc key="<some correct value here, yours is non-existent>" use_cache="no" class="no-datatables" query="order by V asc offset 1"]

    Thread Starter eiriktrials

    (@eiriktrials)

    Hi, thanks for the help. I removed the correct key when I posted here, I had the correct one when I tested. But, that’s not the issue. The issue is that nothing is ordering at all. Whether query I put in, nothing happens. Even with the Select-query, I get all columns.

    Check out nm.biketrial.no/live. The table should be sorting after column V (last one), but it’s sorting after column B, as it is in the original spreadsheet.

    Thanks for helping me out.

    Plugin Author Meitar

    (@meitar)

    This shortcode:

    [gdoc key="https://docs.google.com/spreadsheets/d/15iyVPtRnFhmeASVioNTGOyu1FOO17Kp2db5r5WYuy_Q/edit" use_cache="no" class="no-datatables" query="order by V asc offset 1"]

    Creates a table that is sorted by column V for me in ascending order. That means that currently, the first row has a sum (which is column V) of 0, the second row has a sum of 1, the third row has a sum of 2, the fourth row has a sum of 5, and the fifth row has a sum of 18.

    Thread Starter eiriktrials

    (@eiriktrials)

    Thank you so much. The error I made was the key, which I failed to add the whole url (I only used the ID, which worked for everything except the query).

    This plugin rocks, I can now have the first trials riding competition in Norway with online live results! Cheers!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Sort table in no-datatables’ is closed to new replies.