jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree itemClick not firing

This topic contains 2 replies, has 3 voices, and was last updated by  sudeep 9 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • itemClick not firing #84439

    Justintkw
    Participant

    Hi:

    I am dynamically adding items to the tree using the LoadjqxTreeItems below. The items render jsut fine. However, the itemClick function does not fire. I have tried replacing itemClick with ‘select’. Still it doesn’t fire. Kindly advise as to what I am doing wrong. Thanks!

            function LoadjqxTreeItems() {
                var parentElement = $('#jqxTree').find("#TreeItem_Sessions")[0];
                if (@Model.CSEditList.Count > 0) {
                    var m = @Html.Raw(Json.Encode(Model.CSEditList));
                    for (i = 0; i < @Model.CSEditList.Count - 1; i++) {
                        $('#jqxTree').jqxTree('addTo', { label: m[i].SessionName, id: m[i].CoureSessRID }, parentElement, false);
                    }
                    $('#jqxTree').jqxTree('render');
                }
            }
    
            $('#jqxTree').on('itemClick', function (event)
            {
                var args = event.args;
                var item = $('#jqxTree').jqxTree('getItem', args.element);
                var label = item.label;
                alert(label);
            });
    itemClick not firing #84442

    ivailo
    Participant

    Hi Justintkw,

    We can’t see such a behavior. You can try this demo.
    Check your console for errors.
    Also, please, try to update to the latest version.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

    itemClick not firing #84665

    sudeep
    Participant

    Hi,
    i am using angularjs for tree but i cant fire the event in the tree when i press something…..i have used jqx-on-itemclick..can you help me..
    this is my code….
    <script>
    $scope.press = function (event) {
    alert(“hello”);
    var args = event.args;
    alert(“[” + $(args).text() + “]”);
    };
    </script>
    <body>
    <div ng-app=”demoApp” ng-controller=”demoController”>

    <jqx-tree jqx-on-itemclick=”press($event)” jqx-width=”‘300px'” jqx-height=”‘300px'”>

      <li id=’home’>Home
      <li item-expanded=’true’>Solutions
    • Education
    • Financial services
    • Government
    • Manufacturing
    • Solutions
    • All industries and solutions
  • Products
  • Support
  • Communities
    • Designers
    • Developers
    • Educators and students
    • Partners
    • By resource
  • Company
    • About Us
    • Press
    • Investor Relations
    • Corporate Affairs
    • Careers
    • Showcase
    • Events
    • Contact Us
    • Become an affiliate
  • </jqx-tree>
    </div>
    </body>

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

You must be logged in to reply to this topic.