Skip to main content
Skip table of contents

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:

CODE
{
  "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

image-20240201-155945.png

After using the postProcessor above it will look like this:

image-20240201-160033.png

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:

image-20240201-160256.png

We count rows with the first column equaling 0

CODE
{
  "postProcessors":[
    {
      "processor":"tableSorter",
      "sortList":[
        [
          2,
          0]]
    }]
}

Result:

image-20240201-160400.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.