Title: Problems sorting
Last modified: August 22, 2016

---

# Problems sorting

 *  Resolved [Arkona](https://wordpress.org/support/users/arkona/)
 * (@arkona)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/problems-sorting/)
 * Hello Tobias!
    Need to do the sorting table on the first column in reverse order.
   What would the new documents were at the top of the table. I did this: `"columnDefs":[{"
   orderable": false, "targets": [ 2, 3 ] }, {"order": [0, desc]} ]` Table became
   sorted as needed. But the function Data Tables disabled. Missing the sort arrow,
   instead of 10 rows per page all of 19 rows. Tried to install the extension Table
   Row Order. Upload it to your plugins through FTP. Administrator access to the
   site immediately disappeared. With that, if an administrator logs on to a site,
   there is a failure of CSS and Java scripts do not work. Admin panel is not available
   in general:«502 Bad Gateway. nginx/1.6.0» Remove the extension Table Row Order
   through FTP, access was restored. How best to fix it?
 * [https://wordpress.org/plugins/tablepress/](https://wordpress.org/plugins/tablepress/)

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

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/problems-sorting/#post-5745034)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * These are different issues. In the “Custom Command”, the `desc` needs to be a
   string. Please try again with
 *     ```
       "columnDefs": [ { "orderable": false, "targets": [ 2, 3 ] }, {"order": [0, "desc"] } ]
       ```
   
 * That issue with the Extension sounds really weird. I have no idea what’s going
   on there. It sounds like a server issue. If you still need this Extension, I 
   suggest to install it via the “Plugins” -> “Add New” -> “Upload” form.
 * Regards,
    Tobias
 *  Thread Starter [Arkona](https://wordpress.org/support/users/arkona/)
 * (@arkona)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/problems-sorting/#post-5745329)
 * Hello Tobias!
    Yes, it was a problem with the server. Table Row Order is not 
   to blame. After my complaint corrected. To file .htaccess my site recorded lines:
 * > AddHandler php-cgi .php5 .php
   >  Action php-cgi /cgi-bin/php.fcgi
 * and everything was fine.
    When using the command as you advised interesting effects.
   When the page is loaded for a moment the table is sorted in reverse order, as
   should. And then flipped. Look here: [http://www.pl17yar.ru/home/fin-hoz/obem-od/](http://www.pl17yar.ru/home/fin-hoz/obem-od/)
 *  Thread Starter [Arkona](https://wordpress.org/support/users/arkona/)
 * (@arkona)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/problems-sorting/#post-5745330)
 * Tobias!
    I used the “user commands DataTables” commands a lot of options. They
   or disrupt DataTables JavaScript, or do not work for me. I tried expanding Table
   Row Order with different shortcodes. No change I had not noticed. My table is
   still sorted in ascending order. I thought, sort the table by descending easily,
   but does not work. Small question: at the shortcode datatables_sort = true there
   are options? Which column to sort and in what order? Can reverse the sorting 
   can be done using the shortcode?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/problems-sorting/#post-5745331)
 * Hi,
 * good to hear that you were able to solve this! It basically sounds like you had
   to switch to a different version of PHP on the server, via that change in the.
   htaccess. Nice!
 * Now, all those sorting problems seem to be related to a script issue that I can
   see in the JS error log console in the browser. It seems to be caused by some
   Yandex JS code that you have inserted below the table.
    That code however contains
   HTML `<br />` tags in the JS, which breaks the JS. Can you please fix that JS
   code?
 * Regards,
    Tobias
 *  Thread Starter [Arkona](https://wordpress.org/support/users/arkona/)
 * (@arkona)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/problems-sorting/#post-5745332)
 * Tobias!
    I deleted all about Yandex. I forgot metric in the page template. This“
   metric” is a long time not worked. But nothing has changed. At some point, the
   table is sorted in descending order, then turns to sort in ascending order.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/problems-sorting/#post-5745333)
 * Hi,
 * thanks, that’s good!
 * Now, I just spotted a mistake in the “Custom Command” that I gave you. Sorry 
   for that. Please try again with
 *     ```
       "order": [[ 0, "desc" ]], "columnDefs": [ { "orderable": false, "targets": [ 2, 3 ] } ]
       ```
   
 * Regards,
    Tobias
 *  Thread Starter [Arkona](https://wordpress.org/support/users/arkona/)
 * (@arkona)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/problems-sorting/#post-5745334)
 * Many thanks to Tobias!
    Now everything works fine. Good luck in all affairs.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/problems-sorting/#post-5745335)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias
 *  Thread Starter [Arkona](https://wordpress.org/support/users/arkona/)
 * (@arkona)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/problems-sorting/#post-5745337)
 * Tobias! Sorry to trouble you. Another small question of sorting:
    For example,
   we can use the shortcode `[table id=N datatables_paginate="true" /]`. This include
   a breakdown of the tables on the page. And we has an extra shortcode `[table 
   id=N datatables_paginate_entries=20 /]` that determines how many rows for page.
   Shortcode `[table id=N datatables_sort="true" /]` has additional shortcodes? 
   Which will give the command to determine which column to sort by and the sort
   order? This information I have never found. Thank you in advance for your reply.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/problems-sorting/#post-5745338)
 * Hi,
 * no, setting which columns can be sorted and the sort order can not be set with
   Shortcode parameters. They can only be set with a “Custom Command” as the one
   from above.
    The reason for this is that the configuration for this is more complex
   than just setting e.g. the number of rows per table page.
 * Regards,
    Tobias

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

The topic ‘Problems sorting’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/problems-sorting/#post-5745338)
 * Status: resolved