-
[10sr2][Extension] How to filter more than 1 dimension in an extension
Nicolas Stefaniuk Jun 2, 2011 4:17 PM (in response to Nicolas Stefaniuk)Thread moved in the good forum.
-
[10sr2][Extension] How to filter more than 1 dimension in an extension
Dan English Jun 6, 2011 8:29 AM (in response to Nicolas Stefaniuk)Hi nstefaniuk,
Can you please go through your extension code and strip it down to the absolute bare essentials that will still demonstrate this issue. Can you then attach the extension and the QVW file to this tread. And can you also add click by click instructions to replicate the issue.
If you can do all of that then I will take a look and see what I can tell you.
-Dan
-
[10sr2][Extension] How to filter more than 1 dimension in an extension
Nicolas Stefaniuk Jun 6, 2011 6:13 PM (in response to Dan English )Hi.
I have added my application and my extension to my original post.
As you can see in my application, if you use the table with 1 dimension (based on Fact_2 and Dim1_2), it works
great. Choosing a value of dimension Dim1_2 in the field applies the filter on the table and choosing a value of dimension Dim1_2 in the table applies the filter on the field.
But it doesn't work with the table with 2 dimensions (based on Fact_1 and Dim1_1 and Dim2_1). Choosing a value of dimension Dim1_1 or Dim2_1 in the table applies something on the field, but I don't understand what. In fact in my code I have used _this.Data.SelectRow(i), seen an example, but I don't really understand how it works and how I can use it to filter one dimension or an other one.
Thanks a lot for the pointers.
-
Re: [10sr2][Extension] How to filter more than 1 dimension in an extension
Dan English Jun 16, 2011 7:28 AM (in response to Nicolas Stefaniuk)Hi nstefaniuk,
Well it took me a bit to work this out as there are actually two separate issues here.
The first is a scoping issue. When you define onbasictablerowclick, you are defining it as a global, as soon as you add more than one instance of your extension object on a sheet, you end up overwriting the global function. That is why your selections always were happing in the same field regardless of which extension instance you clicked in.
The solution for that problem is to take the "this" in QvsAddExtension and add it as a member of your HTML table and then navigate up the DOM from your <TD> to the table to call the QlikView AJAX API function to execute the selection. By adding the "this" as a member of the <TABLE> you are free to add as many instances of your extension object as you would like (because each instance has it's own <TABLE>).
The second issue is in fact a bug when you call SelectRow with more than one dimension. I have logged it with support and the BugID is 39616.
The workaround is to use a different function to execute your selections (e.g. SelectTextsInColumn).
I have attached a script.js to this message that illustrates both solutions.
Thanks and regards,
Dan
-
script.js 1.2 K
-
-
-
-