Cancel edit dialog removing shape and dataItem

4 posts, 0 answers
  1. Ralph
    Ralph avatar
    17 posts
    Member since:
    May 2011

    Posted 23 Feb 2015 Link to this post

    Hello, 

    I have come across an issue where shapes are being removed from the diagram when I choose to cancel the edit dialog. The issue seems to be tied to the schema of the dataSource. If I provide a mapping for the 'id' of elements in the dataSource using the cancel button on the edit dialog causes the shape and element to be removed: http://dojo.telerik.com/osOmA/7 

    If this mapping is removed then the shapes function as expected.

    Thanks
  2. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 25 Feb 2015 Link to this post

    Hello Ralph,

    You should change the id field to "id" to avoid the problem:
    schema: {
        model: {
          id: "id",
          fields: {
            id: { from: "Id", type: "number", editable: false },
            Text: { type: "string" }
          }
        }
    }
    The from option basically replaces the original field so "Id" will no longer be defined.

    Regards,
    Daniel
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Ralph
    Ralph avatar
    17 posts
    Member since:
    May 2011

    Posted 25 Feb 2015 in reply to Daniel Link to this post

    Hi,

    Thank you for the response, which does work around the problem. However, could you please enlighten me as to what the point of the mapping is in this case then? It seems like anything other than the following configuration seems to break the diagram. Even leaving this mapping off causes the diagram to break. 
    model: {
      id: "id",
      fields: {
         ...
      }
    }

    Thanks
  5. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 27 Feb 2015 Link to this post

    Hello again,

    I am not sure if I understand the issue. What other configurations have you tried? 
    Mapping the id field is not absolutely necessary. It will be done automatically by the model when setting the id option so you could use either:
    model: {
      id: "id",
      fields: {
        id: { from: "Id", type: "number", editable: false },
        Text: { type: "string" }
      }
    }
    or:
    model: {
        id: "Id",
        fields: {
            Id: { type: "number", editable: false },
            Text: { type: "string" }
        }
    }
    in the specific scenario.

    Regards,
    Daniel
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready