About details for these options, please see: Wiki.
It's will also useful for use with two input-fields.
-
In normally, a picker has been shown/hidden by automatically when necessary.
But you can also catch it, And handle a picker by yourself with using methods of "handler" object.
<input type="text" id="date_foo" value=""> $('#date_foo').appendDtpicker({ "onShow": function(handler){ window.alert('Picker is shown!'); }, "onHide": function(handler){ window.alert('Picker is hidden!'); } });
<input type="text" id="date_jit" value=""> <input type="button" id="btn_generate" value="Generate a picker"> $('#btn_generate').click(function(){ window.alert("Generate"); $('#date_jit').appendDtpicker({ "onInit": function(handler){ handler.show(); }, "onHide": function(handler){ window.alert("Picker is hidden, Then destroy a picker"); handler.destroy(); } }); });
You can handle the appended picker with using "handleDtpicker" method into the input-field.
To handle a picker using handleDtpicker method, call the handleDtpicker method with setting the your hope method-name (e.g. "show" and more) as a parameter.
<input type="text" id="date_manual" value=""> <input type="button" id="btn_manual_generate" value="Generate"> <input type="button" id="btn_manual_show" value="Show"> <input type="button" id="btn_manual_hide" value="Hide"> <input type="button" id="btn_manual_destroy" value="Destroy"> <script type="text/javascript"> $(function(){ $('#btn_manual_generate').click(function(){ $('#date_manual').appendDtpicker({ "inline": true }); }); $('#btn_manual_show').click(function(){ $('#date_manual').handleDtpicker('show'); }); $('#btn_manual_hide').click(function(){ $('#date_manual').handleDtpicker('hide'); }); $('#btn_manual_destroy').click(function(){ $('#date_manual').handleDtpicker('destroy'); }); }); </script>