canjs-control

How to bind an event to Can.Control to run whenever an element matching the selector is added to the control element?

断了今生、忘了曾经 提交于 2020-01-06 03:45:08
问题 I am trying to build a DateTimePicker Widget and do not want to worry about the instantiation of the widget so I have created a Can.Control which takes the html body as the element. But, now my input elements are rendered in the DOM using can.view. How do I bind an event to the insertion of a new dateTime element to my control scope? /** * DateTime Plugin */ plugins.DateTime = can.Control.extend({ },{ init : function ( element , options ){ }, 'input.dateTime click' : function (){ $( this