init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
71
KretaWeb/Scripts/KendoHelper/KretaMaskedTimepicker.js
Normal file
71
KretaWeb/Scripts/KendoHelper/KretaMaskedTimepicker.js
Normal file
|
@ -0,0 +1,71 @@
|
|||
(function ($) {
|
||||
var kendo = window.kendo,
|
||||
ui = kendo.ui,
|
||||
Widget = ui.Widget,
|
||||
proxy = $.proxy,
|
||||
CHANGE = 'change',
|
||||
PROGRESS = 'progress',
|
||||
ERROR = 'error',
|
||||
NS = '.generalInfo';
|
||||
|
||||
var MaskedTimePicker = Widget.extend({
|
||||
init: function (element, options) {
|
||||
var that = this;
|
||||
Widget.fn.init.call(this, element, options);
|
||||
|
||||
var mask = '00:00';
|
||||
var format = 'HH:mm';
|
||||
var parseFormats = 'HH:mm';
|
||||
|
||||
if (typeof options !== 'undefined') {
|
||||
$.each(options, function (index, value) {
|
||||
if (index == 'dateOptions.mask') {
|
||||
mask = value;
|
||||
}
|
||||
if (index == 'dateOptions.format') {
|
||||
format = value;
|
||||
}
|
||||
if (index == 'dateOptions.parseFormats') {
|
||||
parseFormats = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(element)
|
||||
.kendoMaskedTextBox({ mask: mask })
|
||||
.kendoTimePicker({
|
||||
format: format,
|
||||
parseFormats: parseFormats
|
||||
})
|
||||
.closest('.k-timepicker')
|
||||
.add(element)
|
||||
.removeClass('k-textbox');
|
||||
|
||||
that.element.data('kendoTimePicker').bind('change', function () {
|
||||
that.trigger(CHANGE);
|
||||
});
|
||||
},
|
||||
options: {
|
||||
name: 'MaskedTimePicker',
|
||||
dateOptions: {}
|
||||
},
|
||||
events: [CHANGE],
|
||||
destroy: function () {
|
||||
var that = this;
|
||||
Widget.fn.destroy.call(that);
|
||||
|
||||
kendo.destroy(that.element);
|
||||
},
|
||||
value: function (value) {
|
||||
var datetimepicker = this.element.data('kendoTimePicker');
|
||||
|
||||
if (CommonUtils.isNullOrUndefined(value)) {
|
||||
return datetimepicker.value();
|
||||
}
|
||||
|
||||
datetimepicker.value(value);
|
||||
}
|
||||
});
|
||||
|
||||
ui.plugin(MaskedTimePicker);
|
||||
})(window.kendo.jQuery);
|
Loading…
Add table
Add a link
Reference in a new issue