Search code examples
javascriptjointjs

How to update Element from JSON in JointJs


is there any possibility to update an Element from JSON in JointJs?

I'm sending the JsonArray via cellView.model.toJSON() to the Server and manipulate the map. Is there any way to send the changed JsonArray back to the paper by calling something like updateFromJson() on the Element?


Solution

  • Because behind JointJS there is Backbone.

    To update the model we just call model.set(jsonData).

    in your case :
    cellView.model.set(jsonData);
    should do the trick.