2 Replies Latest reply: Sep 17, 2018 6:14 AM by Morne van Zyl RSS

    Sorting in Qlik Sense Table Extension

    Morne van Zyl

      Hi All

       

      I am busy building a Qlik Sense extension which is basically a table with some custom features.

       

      The next feature that I need to implement is sorting. The table does sort when you use the properties panel in "Edit" mode, I would like to add this functionality to the table when the user clicks on the Header of the column.

       

      Some detail on the extension.

      I am using the standard JS, HTML format, not the ng format.

      I have a very basic InitialProperties object which does the initial data fetch. (as below)

      Then I just loop through the Matrix of the DataPage that is returned to create an HTML table.

      There is also a click handler on a button that fetches more data.

      {
              qHyperCubeDef: {
                  qDimensions: [],
                  qMeasures: [],
                  qInitialDataFetch: [{
                      qWidth: 20,
                      qHeight: 50
                  }]
              }
          }
      

       

      I can add a click handler on the headings and pass through the column index. So, I'm looking for a way to re-fetch the data and have it sorted by what is specified within the Properties panel for that Dimension or Measure.

       

      I can see that there is a qSorting property on the qHyperCube but I'm not sure how to set his property and if it would affect the data when I make the call to the backendApi.getData() function.

       

      Thanks in advance.