This is a migrated thread and some comments may be shown as answers.

Change shape and connection style dynamically after added

2 Answers 132 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Jong
Top achievements
Rank 1
Veteran
Jong asked on 20 Jan 2021, 05:58 PM

Hello.

I'm trying to change shapes and connection styles after shapes and connections are added.

I found an answer (https://www.telerik.com/forums/change-color-of-shapes-dynamicaly) but it looks like shape.shapeVisual does not have domElement property anymore.

How can I change change shapes and connection styles dynamically?

Thank you.

2 Answers, 1 is accepted

Sort by
0
Jong
Top achievements
Rank 1
Veteran
answered on 21 Jan 2021, 08:45 PM

I found a solution.

I used redraw() function to change the styles.

connection.redraw({
  stroke: {
    width: 1
  }
});

 

It took me a while to find this function, because it is not in the API reference.

It would be really great to have these functions specified in the API reference.

Thank you!

0
Anton Mironov
Telerik team
answered on 22 Jan 2021, 11:34 AM

Hi Jong,

Thank you for providing the solution for achieving the needed behavior. 

I recently added a knowledge base article for a similar case. Please have a look and advice if it should be updated or additional information is needed:

Appreciate every feedback from your side! 

Kind Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Diagram
Asked by
Jong
Top achievements
Rank 1
Veteran
Answers by
Jong
Top achievements
Rank 1
Veteran
Anton Mironov
Telerik team
Share this question
or