Hi,
thanks for your post, and sorry for the trouble.
Do these rows have a red background color on the table’s “Edit” screen? And what’s the full Shortcode that you are using to embed the table on this page?
Regards,
Tobias
Hi Tobias,
Thank you for your quick response! Yes, the two rows do have a red background on the Edit screen.
Here is the shortcode on the page:
[table id=2 responsive=collapse row_order=sort row_order_sort_column=H row_order_sort_direction=ASC /]
Here are the custom commands I am using:
"columnDefs": [ { "className": "none", "targets": [ 3, 4, 5, 6 ] }, { "orderable": false, "targets": [ 0 ] } ]
Hi,
thanks for that! From the Shortcode, I can see that you are using the TablePress Table Row Order Extension here as well. And that’s where this problem comes from: The sorting is done before the hidden rows are removed (still by row number), so essentially two other rows will have been removed here.
To make this work here, you will need to do a small code change. In the file /wp-content/plugins/tablepress-table-row-order/tablepress-table-row-order.php on your server, please change line 55 from
add_filter( 'tablepress_table_evaluate_data', array( __CLASS__, 'tablepress_table_render_data' ), 10, 3 );
to
add_filter( 'tablepress_table_render_data', array( __CLASS__, 'row_order_after_evaluate_processing' ), 10, 3 );
Regards,
Tobias
Hi Tobias,
Unfortunately my line 55 does not match yours. This is my line 55:
add_filter( 'tablepress_table_evaluate_data', array( __CLASS__, 'row_order_after_evaluate_processing' ), 10, 3 );
Hi,
ah, my bad. I edited something in the wrong line. Your line 55 is correct. Please change that to
add_filter( 'tablepress_table_render_data', array( __CLASS__, 'row_order_after_evaluate_processing' ), 10, 3 );
(i.e. evaluate needs to be changed to render in the first part).
Regards,
Tobias