Add dataItem to a new shape being added to the diagram

1 posts, 0 answers
  1. Michelle
    Michelle avatar
    2 posts
    Member since:
    Jul 2010

    Posted 25 Sep 2015 Link to this post


    I am adding a Shape via a drag and drop function. I am looking to also add a default dataItem to the options of this Shape.


        drop: function (e) {
            var item, pos, transformed;
            if (e.draggable.hint) {
                item ="shape");
                pos = e.draggable.hintOffset;
                pos = new Point(pos.left,;
                transformed = diagram.documentToModel(pos);
                item.x = transformed.x;
                item.y = transformed.y;
                //Want to add default dataItem or find a better place to add.


    Here is what my current dataItem look like from other shapes added by Read method. Attached Item.

    I want to be able to add this data item like the diagram would normally do but through a drag and drop action. So it can be saved back to the database.






Back to Top