Forum Discussion
Custom visual Table using Javascript : Filter Row, Column and single Cell
- Anonymous7 years ago
I solved by my self.
Here is the fragment of code I have used, maybe it could help others.
private static getSelectionIds(dataView: DataView, host: IVisualHost): ISelectionId[] { return dataView.table.identity.map((identity: data.SelectorsByColumn) => { const categoryColumn: DataViewCategoryColumn = { source: dataView.table.columns[1], values: null, identity: [identity] }; return host.createSelectionIdBuilder() .withCategory(categoryColumn, 0) .createSelectionId(); }); }Using this I am able to filter the table by row. I am talking abot versione 2.5.0. The version for 1.6 suggest by someone on internet is:
private static getSelectionIds(dataView: DataView, host: IVisualHost): ISelectionId[] { return dataView.table.identity.map((identity: DataViewScopeIdentity) => { const categoryColumn: DataViewCategoryColumn = { source: dataView.table.columns[0], values: null, identity: [identity] }; return host.createSelectionIdBuilder() .withCategory(categoryColumn, 0) .createSelectionId(); }); }Thank you anyway,
Francesco Multari
Hi,
Check this article please.
Kind Regards,
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected]
- Anonymous7 years agoNot applicable
Hi,
I alredy know that link, but there is no explation about dealing with table in capabilities.
That link works only with category.Could you kindly give me other example?
Thank you,Francesco
- v-evelk7 years ago
Microsoft Employee
Hi Francesco,
You should use API 2.5. It contains .withTable method of the builder that must solve selection issues with Table mapping.
Kind Regards,
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected]- Anonymous7 years agoNot applicable
Hi, I am using the version API 2.5 but I am little confused using withTable. Could you give me an example?
Moreover, using withTable I can only filter by row number, right?