jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree jqxTree Knockout Selectable ???

This topic contains 3 replies, has 2 voices, and was last updated by  AKaplan 10 years, 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • jqxTree Knockout Selectable ??? #57642

    AKaplan
    Blocked

    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?

    jqxTree Knockout Selectable ??? #58706

    AKaplan
    Blocked

    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?

    jqxTree Knockout Selectable ??? #58709

    Dimitar
    Participant

    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,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    jqxTree Knockout Selectable ??? #58978

    AKaplan
    Blocked

    What’s the point of that? In what application scenario do I only need to view the control and not interact w it?

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.