Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change label on an mxgraph cell/vertex

I've created an interface, including mxgraph (javascript), that allows a user to click on a cell and edit the cell's label in a regular form text input that's separate from the graph. I'd like to change the cell's label after the user saves the form (ajax submit) without having to reload the graph.

I really don't need to do anything fancy with a cell/vertext label, but I do need to be able to change it's text. I don't need HTML labels if that's avoidable. And, I haven't found something like a "setLabel" method in the API.

Sounds like a simply thing. What am I missing?

Thanks

like image 588
Gary C. Avatar asked Dec 23 '22 18:12

Gary C.


1 Answers

Set the value on the cell via the model:

graph.model.setValue(cell, value);
like image 51
Thomas the Tank Engine Avatar answered Jan 06 '23 17:01

Thomas the Tank Engine