Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i am working on a table extension which is based on jquery's data table. I set the qHeight initially to 200. When i sort my table (lets say by the first measure desc) i would expect to see the first largest 200 rows - whichdoesnt necessarily have to match the initially loaded 200 rows. So I assume that i have to catch the sorting event and then get new data which fits to the sorting i applied...but how would i do this ?
Hope, i described my problem in an understandable way
Thanks for some hints!
Hi Philipp,
Just to summarize what you have said....
You need to show the highest 200 sales(Sales for example) when your table is sorted, irrespective if the table before sorting had the necessary data or not.
If this is the case. I would suggest you to send a request for the top 200 sales by fetching results from a hypercube. So this way it will be easy for you to restrict the amount of data being fetched as well.
Thanks,
Sangram
Hi Sangram,
thanks for your reply. Your understanding is correct. The full set of data contains appr. 72000 rows. I am initializing to get only 200. At this point the table is not sorted in any way. By clicking a column header (like "Sales") to sort the sales desc i would expoect to get the top 200 rows from the cube.
This is the only way i (currently) know to request data:
// load more data here
var requestPage = [{
qTop : lastrow + 1,
qLeft : 0,
qWidth : 10, //should be # of columns
qHeight : 200
}];
// call paint again and pass the dummy for the target page number
self.backendApi.getData(requestPage).then(function(dataPages) {
self.paint($element, layout);
});
Can i use the above way to request the top 200 rows ? If yes, how ?
Thanks!
Hi Philipp,
As you need to sort a particular measure column. Add this code to your config part of the visualization extension. This will help you sort the columns:
By defining qInterColumnSortOrder, numerical sorting on the measure is enabled.
initialProperties : {
version : 1.0,
qHyperCubeDef : {
qDimensions : [],
qMeasures : [],
qInterColumnSortOrder : [1,0]
qInitialDataFetch : [{
qWidth : 10,
qHeight : 50
}]
}
}