removed typedef 2.0 {Object} source The event object dispatched when an element is removed from the document. Object Properties target {HTMLElement} The attribute that changed. type="removed" {String}Optional The type is always "removed" for a removed event. bubbles=false {Boolean}Optional Removed events do not bubble. Use Listen to a removed event on an element with the base-library's NodeList. For example, with jQuery: $(el).bind("removed", function(ev){ ev.type // "removed" ev.target // el }) $(el).remove() Listen to a removed event with can.Control like: can.Control.extend({ "removed": function(el, ev){ } }) Call a method when an element is removed within a template like: <div can-removed="destroyItem">...</div> Listen to a removed event with can.Component's events object like: can.Component.extend({ tag: "panel", events: { "removed": function(el, ev){ } }) To create a removed event, you must use the base-library NodeList's DOM modifier methods. For jQuery or Zepto, use $.fn.html, $.fn.remove, $.fn.empty, etc: $(el).remove(); For Mootools use Element::set $(el).destroy() For Dojo, use dojo.destroy; dojo.destroy(el); For YUI use remove like: Y.NodeList(el).remove();
Use
Listen to a
removed
event on an element with the base-library's NodeList. For example, with jQuery:Listen to a
removed
event with can.Control like:Call a method when an element is removed within a template like:
Listen to a
removed
event with can.Component's events object like:To create a
removed
event, you must use the base-library NodeList's DOM modifier methods.For jQuery or Zepto, use
$.fn.html
,$.fn.remove
,$.fn.empty
, etc:For Mootools use Element::set
For Dojo, use
dojo.destroy
;For YUI use
remove
like: