Slider does not support MVVM
by grippstick
HTML
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.3.1114/styles/kendo.default.min.css">
<script src="https://kendo.cdn.telerik.com/2016.1.112/js/kendo.all.min.js"></script>
<script src="https://aligntoday.com/js/Radolo.Common.js/jquery.uniform.js?v=06_26_2016_10_PM"></script>
<div id="example">
<div data-bind="text:value">
</div>
<input data-role='uniform' type='radio' value='Red' data-group-name='Colors' data-bind='value:value,events:{change:checkChanged}' />
<input data-role='uniform' type='radio' value='Blue' data-group-name='Colors' data-bind='value:value,events:{change:checkChanged}' />
</div>
JavaScript
/*
radoloUniform v1.0.0
Copyright © 2013 Joshua Grippo / Radolo
http://radolo.com
executes a jquery.uniform on the element if the data-role='uniform'
ex. 1: <input type='checkbox' data-role='uniform' data-binding='value:checkValue,events:{change:checkChanged}' data-change-click-only='true'/>
ex. 2:
<input data-role='uniform' type='radio' value='Red' data-group-name='Colors' data-bind='value:objectColorValue'/>
<input data-role='uniform' type='radio' value='Blue' data-group-name='Colors' data-bind='value:objectColorValue'/>
*/
var kendo = window.kendo,
ui = kendo.ui,
Widget = ui.Widget,
support = kendo.support,
ns = ".radoloUniform",
CHANGE = 'change',
CLICK = 'click';
kendo.data.binders.widget.uniformName = kendo.data.Binder.extend({
refresh: function() {
var $element = $(this.element);
var value = this.bindings["uniformName"].get();
$element.attr('name', value);
}
});
var Uniform = Widget.extend({
init: function(element, options) {
if (!$(element).is('input')) {
console.warn("data-role=uniform can only be used on input elements");
console.warn(element);
throw "data-role=uniform can only be used on input elements";
}
var that = this;
that._initializing = true;
kendo.ui.Widget.fn.init.call(that, element, options);
element = that.element;
options = that.options;
var inputType = element.attr('type');
if (!inputType) {
element.attr('type', 'checkbox');
inputType = 'checkbox';
}
that._IsCheckBox = inputType === 'checkbox';
that._value = element.val();
//lets convert to a proper true/false for radio buttons.
if (that._value === 'false') {
that._value = false;
}
if (that._value === 'true') {
that._value = true;
}
if (options.groupName) {
element.attr('name', options.groupName);
}
//we need to set our default
if (that._IsCheckBox) {
that._old = element.is(':checked')
}...