I have an event on right click, and when I trigger it, I have set the parent ID of the item I’m right clicking on my items attributes in the html.
Like this:
<span class="badge unitOnCall left" style="background: {{statusColor}}; color: {{textColor}};" callId="{{../_id}}" callNo="{{../callNo}}">{{unit}}</span>
In another event (double click) I get both the parent id and parent callNo with the following:
let callId = event.currentTarget.getAttribute('callId'); let callNo = event.currentTarget.getAttribute('callNo');
These both work flawlessly.
I have tried to use them in the event on right click, and get either null, or undefined.
I have also tried this._id which was working up until today, and now I only get null or undefined.
When I look in the inspector at the formed html for the element, it shows the proper _id for the parent as it should, so I don’t know why I’m suddenly unable to get this value on right click.
Any help, or thoughts are greatly appreciated.
Additionally, I tried, <span class="badge unitOnCall left" style="background: {{statusColor}}; color: {{textColor}};" data-callid="{{../_id}}" callNo="{{../callNo}}">{{unit}}</span>
with
let callId = event.currentTarget.dataset.callid;
based on another post on the forums, but still no luck.
I believe it is targeting correctly. I get the console logging I expect for the event, but no data. I’ll try the console.dir of the event.currentTarget and see what I see.