Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
organgrindingmo
Partner - Contributor III
Partner - Contributor III

Sorting in Qlik Sense Table Extension

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.

1 Solution

Accepted Solutions
ErikWetterberg

Hi,

I once did this in an extension that you'll find here:

https://github.com/erikwett/qsDynamicTable/blob/master/dynamictable.js

The trick is that it modifies the InternalSortOrder array dynamically, by calling applyPatches.

Erik Wetterberg

https://extendingqlik.upper88.com/

View solution in original post

2 Replies
ErikWetterberg

Hi,

I once did this in an extension that you'll find here:

https://github.com/erikwett/qsDynamicTable/blob/master/dynamictable.js

The trick is that it modifies the InternalSortOrder array dynamically, by calling applyPatches.

Erik Wetterberg

https://extendingqlik.upper88.com/

organgrindingmo
Partner - Contributor III
Partner - Contributor III
Author

Thanks so much, your solution works perfectly.

I also read your blog post about it, great article.

https://extendingqlik.upper88.com/dynamically-modify-a-qlik-sense-visualization/