jQuery UI Widgets › Forums › General Discussions › Navigation › Tree › jqxTree Knockout Selectable ???
Tagged: Integration, item, jqxKnockout, jqxtree, Knockout, method, select, selectItem, Tree
This topic contains 3 replies, has 2 voices, and was last updated by AKaplan 11 years, 10 months ago.
-
Author
-
In a knockout environment, how can I add the function of the select event to the control such as,
<div data-bind="jqxTree:{source: [], select: $data.selectedItem }"></div>All the demos are in a jquery selector format, and that doesn’t work well w context control.
I’ve tried overriding and expanding on the control, but that’s not working because I might be doing something wrong.var originalJqxTreeInit = ko.bindingHandlers.jqxTree.init, originalJqxTreeUpdate = ko.bindingHandlers.jqxTree.update; ko.bindingHandlers.jqxTree = { init: function (element, value, allBindings, viewModel) { var wrappedValue = function () { return function (data, event) { ko.bindingHandlers.jqxTree.select.call(viewModel, data, event); value().call(viewModel, data, event); }; }; originalJqxTreeInit(element, wrappedValue, allBindings, viewModel); }, update: originalJqxTreeUpdate, select: function (event) { var args = event.args, item = $(args.element).jqxTree('getItem', args.element), dropDownContent = '<div style="position: relative; margin-left: 3px; margin-top: 5px;">' + item.label + '</div>'; $(args.element).jqxDropDownButton('setContent', dropDownContent); } }can someone point me in the right direction?
this is so stupid… how can a company produce a control without a select method?! How is anyone going to be able to interact w it?! Can someone please help?
Hello AKaplan,
jqxTree has a method for selection, called selectItem. Unfortunately, this method has still not been implemented in the jqxKnockout plug-in. The only available settings as of now are source and disabled, as you can see from the plug-in’s API Documentation.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/What’s the point of that? In what application scenario do I only need to view the control and not interact w it?
-
AuthorPosts
You must be logged in to reply to this topic.