带有敲落组件的jquery移动滑块

时间:2016-10-20 15:13:48

标签: jquery jquery-mobile knockout.js

我正在尝试使用knockout组件绑定来自jquery移动滑块的值。但我没有那样做。有没有解决方案,除了自定义绑定? 我的js-code:

 ko.components.register('slider', {

            viewModel: {

                createViewModel: function (componentInfo) {
                    $(componentInfo.element).slider("refresh");

                }

            },

            template: { element : 'netval'}

        });

        var viewModel = function (value) {
            var self = this;
            self.value = ko.observable(value);
            self.id = ko.observable("slider-new");
            self.min = ko.observable(10);
            self.max = ko.observable(100);
        };
        var Model = new viewModel(50);
        ko.applyBindings(Model);

My fiddle

0 个答案:

没有答案