Forum Discussion
Multiple selection in custom visual
Hi everyone.
I wanted to know, how to do multple selection using pressed CTRL button and mouse click, instead of mouse click. I set
Hello ysapiyev,
You should use something like this (event documentation):
// event is a mouse event const isCtrlKeyPressed = event.ctrlKey; this.selectionManager.select(d.identity, isCtrlKeyPressed);
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
6 Replies
- v-viigCommunity Champion
Hello ysapiyev,
You should use something like this (event documentation):
// event is a mouse event const isCtrlKeyPressed = event.ctrlKey; this.selectionManager.select(d.identity, isCtrlKeyPressed);
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- ysapiyevResponsive Resident
Hello v-viig,
So ,as I understood, it should look like this, right?
var event = <Event>d3.event; const isCtrlKeyPressed =event.ctrlKey; this.selectionManager.select(d.identity, isCtrlKeyPressed);
However, it shows me that there is no property ctrlKey in event. I googled, and it gives me similar solution as yours. What can be wrong?
Regards,
Yerkhan
- ysapiyevResponsive Resident
- v-viigCommunity Champion
That code snippet looks good.
Can you share the whole source code for debugging?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals