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,
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
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?- v-evelk7 years ago
Microsoft Employee
Hi,
There is no documentation with examples for a while but yes, you need to set rowNumber and colNumber like here.
Kind Regards,
Evgenii Elkin,
Software Engineer
Microsoft Power BI Custom Visuals
[email protected]- Anonymous7 years agoNot applicable
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