UNPKG

datatables.net-datetime

Version:

DateTime picker for DataTables.net

29 lines (23 loc) 1.03 kB
<?xml version="1.0" encoding="UTF-8" ?> <dt-api library="DateTime"> <name>owns()</name> <summary>Check if an element belongs to this control.</summary> <since>1.0.0</since> <type type="function"> <signature>owns(node)</signature> <description>Check if an element belongs to this control.</description> <parameter type="node" name="node"> Element to check. </parameter> <returns type="boolean">`true` if owned by this control, `false` otherwise.</returns> </type> <description> This method takes a node as a parameter and returns `true` if it belongs to this control, `false` if not. It can be useful to know this information when creating a form that has multiple click event handlers and you might need to know if a click happens inside the date picker, or elsewhere in your form. </description> <example title=""><![CDATA[ var dt = new DateTime(document.getElementById('example')); if (dt.owns(document.getElementByClassName('dt-datetime-date'))) { console.log('It is owned'); } ]]></example> </dt-api>