Can’t disabled table sorting
-
Hi,
I have turned off DataTables but I still get sorting features. I even tried to turn off the header row but it still appears. Then I tried installing ablePress Extension: Turn off Output Caching but i still get the sortable table headers. Any ideas how I can turn sorting off?The page I need help with: [log in to see the link]
-
Hi,
thanks for your post, and sorry for the trouble.
What’s the exact Shortcode that you have added to that page? My guess here is that that contains the Shortcode parameter to turn sorting on (again).
Regards,
TobiasThanks for the quick reply – VERY APPRECIATED
[table id=neurology-top10 responsive=collapse automatic_url_conversion=true/]
Hi,
ok, that’s strange, because this table actually also has the
collapsemore for responsiveness turned on… If that’s not done via the Shortcode, it would mean that the TablePress Extension’s PHP file was modified (which is ok).Can you please set that Shortcode to
[table id=neurology-top10 responsive=collapse automatic_url_conversion=true shortcode_debug=true /]When you then open that page with the table while you are logged in, you should see a chunk of code below the table, namely the full configuration that was used to render this table. Can you please post that here?
Regards,
TobiasHere is the debug code
array ( 'id' => 'neurology-top10', 'column_widths' => '', 'alternating_row_colors' => false, 'row_hover' => true, 'table_head' => true, 'table_foot' => false, 'first_column_th' => false, 'print_name' => false, 'print_name_position' => 'above', 'print_description' => false, 'print_description_position' => 'below', 'cache_table_output' => false, 'convert_line_breaks' => true, 'extra_css_classes' => 'tablepress-responsive', 'use_datatables' => true, 'datatables_sort' => true, 'datatables_paginate' => true, 'datatables_paginate_entries' => 10, 'datatables_lengthchange' => true, 'datatables_filter' => true, 'datatables_info' => true, 'datatables_scrollx' => false, 'datatables_scrolly' => false, 'datatables_custom_commands' => '', 'datatables_locale' => 'en_US', 'show_rows' => '', 'show_columns' => '', 'hide_rows' => '', 'hide_columns' => '', 'cellspacing' => false, 'cellpadding' => false, 'border' => false, 'shortcode_debug' => true, 'automatic_url_conversion' => true, 'automatic_url_conversion_new_window' => false, 'automatic_url_conversion_rel_nofollow' => false, 'responsive' => 'collapse', 'responsive_breakpoint' => 'phone', 'html_id' => 'tablepress-neurology-top10', 'edit_table_url' => 'https://www.raremedicalnews.com/wp-admin/admin.php?page=tablepress&action=edit&table_id=neurology-top10', )Hi,
thanks! That configuration has the sorting turned on, so if the “Sorting” checkbox really is turned off, there must be custom PHP code in use on the site that is turning it on again. You would then however probably know about that.
Can you please double-check if the “Sorting” checkbox really is turned off for this table?Regards,
TobiasINteresting. Yeah I’m sure it is disabled. Hmm.. maybe I’m missing something. Here is a screenshot. https://share.getcloudapp.com/v1u0L9Y1
Hi,
ok, now I’m getting really curious as to what’s going on here…
Could you maybe get in touch via email (the address is on https://tablepress.org/impressum/ ).Thanks!Regards,
TobiasYup 🙂
Just wanted to let you now I did send the email
Hi,
thanks, I have received it and will take a look as soon as possible!
Regards,
TobiasHi,
ok, I took a look at this and found the reason: While the “Use DataTables” and “Table Head” checkboxes were properly turned off, they are turned on again “behind the scences” – as they are requirements for the
collapsemode to work.
So, instead of turning those off, it’s necessary to turn off the checkboxes for the actual features (Sorting, in this case). On your site, the sorting of the table should now be turned off, as expected.Now, I did notice that there’s some CSS code in use on the site (I couldn’t find out where it is, just that it’s not in the TablePress “Custom CSS”), that hides the controls for the table search, length change, and pagination. This is not ideal, in my opinion, as it can’t disguise that these features are active. This is not so much a problem for the search, but for the pagination: If that’s active for a table (via the checkbox), you would only be seeing tables with 10 rows and wouldn’t really know why, as the pagination controls would be hidden.
I therefore recommend to remove that CSS code (.dataTables_length, .dataTables_filter, .dataTables_info, .dataTables_paginate { display: none; }) and instead turn these features of on the table’s “Edit” screen. That also makes the loading faster.
Regards,
Tobias
The topic ‘Can’t disabled table sorting’ is closed to new replies.