标签:clear ssh java init focus highlight cti handler knockout
/* my97datepicker 时间格式‘yyyy-MM-dd HH-mm-ss‘ */ ko.bindingHandlers.datetimes = { init: function (element, valueAccessor, viewModel) { var value = ko.utils.unwrapObservable(valueAccessor()); $(element).attr("class", "Wdate"); $(element).focus(function () { WdatePicker({ isShowClear: false, readOnly: true, dateFmt: ‘yyyy-MM-dd HH:mm:ss‘ }); }); $(element).val(value); }, update: function (element, valueAccessor, viewModel) { var value = ko.utils.unwrapObservable(valueAccessor()); $(element).val(value); $(element).blur(function () { var v = $(element).val(); valueAccessor()(v); }); } };
<input id="date_times" data-bind="datetimes:forms.dates" data-options="required:true" style="width: 150px;" />
标签:clear ssh java init focus highlight cti handler knockout
原文地址:http://www.cnblogs.com/amylis_chen/p/6629415.html