SG
Shyam G
Syncfusion Team
March 14, 2016 08:41 AM UTC
Hi David,
You have created a custom property by inheriting the node class, but we have some limitations as shown below.
Limitations:
1. The custom property gets serialized only if the default value and property value are different.
2. Also we have used this serializer to format the object to JSON data internally and send it from the server side to the client side. So if you need any additional features in this method it will not be implemented.
r
Instead of creating the custom property by inheriting the node class, please create an custom property for the node using node’s addInfo property. Please refer to the code example and sample below.
Code example:
BasicShape node = new BasicShape();
node.Name = name;
Dictionary<string, object> addInfo = new Dictionary<string, object>();
//add an custom property for the node
addInfo.Add("email", "gs@gmail.com");
addInfo.Add("phone", "99898989");
node.AddInfo = addInfo;
//define click event
model.Click = "click";
<script type="text/javascript">
function click(args) {
var node = args.element;
if (args && args.element.type == "basic") {
//get an custom property in the client side
alert("email" + ":" + args.element.addInfo.email + "\n" + "phone" + ":" + args.element.addInfo.phone);
}
}
</script>
Sample:http://www.syncfusion.com/downloads/support/forum/123378/ze/addInfoMVCsample-518592233
Regards,
Shyam G