Alpha Print Table Sorter - User Instructions
The installation of this Plugin will allow you to sort your table columns in a PRINT table. To set this up you will need to navigate to the section layout of the PRINT table you are using and open the Advanced settings to enter the post processor code snippet. The sorting configuration within the tableSorter
post-processor allows you to define the initial sorting order for a table. In the provided code snippet:
{
"postProcessors":[
{
"processor":"tableSorter",
"sortList":[
[
0,
0]]
}]
}
the sortList
array is used to specify the sorting parameters. The element [0, 0]
signifies the following:
Column Index (First Element): The value
0
represents the index of the column based on which the sorting should occur. In programming conventions, column indices often start from 0. In this case, it indicates the first column of the table.Sorting Direction (Second Element): The value
0
designates ascending order. This means that the table will be initially sorted in ascending order based on the values in the specified first column.
To customize the sorting behavior, you can modify the sortList
array. For instance, [1, 1]
would sort the table based on the second column in descending order.
This configuration offers flexibility in tailoring the initial presentation of tabular data to suit your specific requirements. Adjust the values within the sortList
array to achieve the desired sorting outcome for your table.
So to put some more visuals to match the explanation, here are some examples.
Sort by ID
After using the postProcessor above it will look like this:
Sort by test result
If you’d like to sort your test table by result rather than id, then you can adjust the postProcessor to match your target column, so for this example table you can find the adjusted postProcessor as well as the result below:
{
"postProcessors":[
{
"processor":"tableSorter",
"sortList":[
[
2,
0]]
}]
}
Result: