• Resolved wolkensprung

    (@wolkensprung)


    Hi there
    I tried to sort a Google Spreadsheet by columne C ascending. Checked Google, FAQ and Forum but didn’t find the correct answer… ??

    The User story is like:
    As a visitor
    I want to see a list of registered persons sorted by name ascending,
    so I know if my colleague has already registered.

    The shortcode I used is as follows:
    [gdoc key=”https://docs.google.com/spreadsheets/d/1NfBRyfCipo9g-GNvztqhL1XVZribYBpfJg5q2OV40BY/edit?usp=sharing” query=”select C, D” datatables_page_length=”1000″ datatables_order=’%5B%5B 2, “asc” %5D%5D’]

    I only want to display columne C and D (query=”select C, D”), no pagination as I expect less than 1000 participants (datatables_page_length=”1000″) and sorting ascending by Name = columne C (datatables_order=’%5B%5B 2, “asc” %5D%5D’)
    But sorting doesn’t work… What’s the fish? How to solve this?

    Thanks for every helpful answer in advance…

    Cheers
    Wolkenpsrung

    The page I need help with: [log in to see the link]

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

    (@meitar)

    There is no column 2 if your select only returns two columns. There are only columns 0 and 1. Try

    datatables_order='%5B%5B 0, "asc" %5D%5D'
    

    0 is the first column selected.

    Thread Starter wolkensprung

    (@wolkensprung)

    Hi Meitar

    Thx – works perfect, I was thinking about the original spreadsheet not about the selected data table – stupid me…
    If I set class=”no-datatables” the sorting don’t work – guess this is quite logic, you can’t use datatable functionalities in no-datatables class – or is there another possibility?

    Thx anyway, it’s a great plugin you wrote!

    Cheers
    Wolkensprung

    Plugin Author Meitar

    (@meitar)

    Just sort using the original query using order by.

    Thread Starter wolkensprung

    (@wolkensprung)

    Thx for your quick answer – but it still don’t work as expected… ??

    Shortcode:
    [gdoc key=”https://docs.google.com/spreadsheets/d/1NfBRyfCipo9g-GNvztqhL1XVZribYBpfJg5q2OV40BY/edit?usp=sharing/gviz/tq?tq=order%20by%20Name%2C%20Vorname%20-%20Nom%2C%20Pr%C3%A9nom%20asc” query=”select C, D” class=”no-datatables” datatables_page_length=”1000″]

    If I remove class=”no-datatables” it works perfect, except that there are the data table search/filter/export buttons present…

    But no worry, I can live with this issue, it’s just a trash site ??

    Thx a lot for your support and cheers!
    Wolkensprung

    Plugin Author Meitar

    (@meitar)

    You didn’t change the query, you changed the key. Try this:

    [gdoc key=”https://docs.google.com/spreadsheets/d/1NfBRyfCipo9g-GNvztqhL1XVZribYBpfJg5q2OV40BY/edit” query=”select C, D order by C” class=”no-datatables”]
    

    Note the order by clause in the query.

    Thread Starter wolkensprung

    (@wolkensprung)

    Thx, of course you’re right… But I tried it – getting an error:
    <zip>
    Error requesting data: cURL error 6: Could not resolve host: docs.google.xn--comhttps-fq3d
    <zap>
    Strange – Google spreadsheet is available, the same error occurs, if I set “?usp=sharing” at the end of the key…

    Short google search let suspect some IPv6 / DNS error ?? as I have no full access to the server, I can’t change any resolv.configs or similar…

    Any other ideas? Otherwise, as I wrote: I can live with this minor issue…

    Thx anyway and cheers
    Wolkensprung

    Plugin Author Meitar

    (@meitar)

    Yes, that’s a network error, so is up to your hosting provider to resolve.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Sorting 3rd columne of a Google Spreadsheet’ is closed to new replies.