On our dimension column, we have options like 1x4, 2x4, 1x6, 1x8, etc. Sorting by this field sorts alpha-numerically which doesn't make sense in lumber so we need to customize the sort order. How can we accomplish this?
Are you requiring this sorting to be determined by filtering? If so, you can achieve custom sorting only if you enter the values manually, that will show in the drop down menu.
If you want the table to be shown with a specific order in the column, you can add an integer table, and add the numbers, and set the table to be automatically filtered per that column.
Hello. What I need is when a user sorts by the dimension column, it is sorted a specific order.
So instead of sorting the values: (1x6, 1x10, 1x12, 1xRW) the way they are right now, (1x10, 1x12, 1x6, 1xRW), I need to be able to set them in our desired sort order. (1x6, 1x10, 1x12, 1xRW).
Previously I was able to set a "value|label" pair and was able to sort on the value instead of the label. That is ultimately what I need to do.
Since this is a string-type column, the sorting behavior cannot be changed to suit your needs.
A workaround in this situation would be to add a new integer column and add an ID to each row, so it corresponds to the sorting you desire to achieve with this column.
For example:
If I understood correctly, 1 = 1x4; 2 = 2x4; 3 = 1x6; 4 = 1x8, so you can access the settings of this column, and in the Conditional Formatting tab, create a rule for each ID, like this:
The table will use numerical sorting, and it will follow 1, 2, 3, 4... but the content of the column will be displayed like this:
As you can see in the screenshot above, the column SK is sorted in an ascending fashion, and it is showing correct data.
On our dimension column, we have options like 1x4, 2x4, 1x6, 1x8, etc. Sorting by this field sorts alpha-numerically which doesn't make sense in lumber so we need to customize the sort order. How can we accomplish this?
Hi Trace,
thank you for reaching out to us
Are you requiring this sorting to be determined by filtering? If so, you can achieve custom sorting only if you enter the values manually, that will show in the drop down menu.
If you want the table to be shown with a specific order in the column, you can add an integer table, and add the numbers, and set the table to be automatically filtered per that column.
Hello. What I need is when a user sorts by the dimension column, it is sorted a specific order.
So instead of sorting the values: (1x6, 1x10, 1x12, 1xRW) the way they are right now, (1x10, 1x12, 1x6, 1xRW), I need to be able to set them in our desired sort order. (1x6, 1x10, 1x12, 1xRW).
Previously I was able to set a "value|label" pair and was able to sort on the value instead of the label. That is ultimately what I need to do.
Hi Trace,
thank you for the details!
I would need to escalate it to my senior colleague to see how can we achieve this; he will contact you back as soon as possible.
Hello Trace.
Since this is a string-type column, the sorting behavior cannot be changed to suit your needs.
A workaround in this situation would be to add a new integer column and add an ID to each row, so it corresponds to the sorting you desire to achieve with this column.
For example:
If I understood correctly, 1 = 1x4; 2 = 2x4; 3 = 1x6; 4 = 1x8, so you can access the settings of this column, and in the Conditional Formatting tab, create a rule for each ID, like this:
The table will use numerical sorting, and it will follow 1, 2, 3, 4... but the content of the column will be displayed like this:
As you can see in the screenshot above, the column SK is sorted in an ascending fashion, and it is showing correct data.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables