I want to bind a function to an element on a custom shape [SOLVED]


I need to hook the onchange event of an element on a custom shape.
When I put the following code and precompile it using LaravelMix, I get an error when displaying the chart.
Is there any way to solve this problem?

$(".flow-selector").on(‘change’, function () {

Error is
Uncaught TypeError: n is not a function


This is the known problem. You may workaround it assigning the event handlers after the diagram initialization.


Thanks for the sample, it solved my problem.


In the dhx.Diagram 3.1.0 update we’ve added the possibility to assign the event handlers to the custom shapes in your diagram.
Now it can be achieved using the eventHandlers property: