@chinenyem wrote:
Hello. I am new to gojs. I am trying to change the text on a node via the context menu. I was baiscally following the change color example.
case "Color": { var color = document.elementFromPoint(event.clientX, event.clientY).parentElement.style.background; var what = document.elementFromPoint(event.clientX, event.clientY).parentElement; console.log(what) changeColor(diagram, color); break; }
The change color example console.logs the correct parent. However when I console.log the parent of tickets I get the sidebar menu. The parent of the ticket value is a select option.
case "tickets": { console.log(this) var text = document.elementFromPoint(event.clientX, event.clientY); console.log(text) changeColor(diagram, color); break; } <select class="form-control textContext" id="cut" size="4" onchange="cxcommand(this.value)"> <option value="ticketsd">Tickets</option> <option value="indicatorsd">Tickets</option> <option value="assetsd">Tickets</option> <option value="ticketsd">Tickets</option> <option value="indicatorsd">Tickets</option> <option value="assetsd">Tickets</option> </select>
Posts: 2
Participants: 2