jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree Invisible Tree

Tagged: 

This topic contains 11 replies, has 3 voices, and was last updated by  Peter Stoev 9 years, 6 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
  • Invisible Tree #78395

    zakstev
    Participant

    hi

    I’m trying to load Tree Items via Ajax as per the demo on your website, But it shows completely blank in browser. Please help

    Thanks in advance…

    Regards,
    M.Z

    Invisible Tree #78407

    zakstev
    Participant

    <%@ page language=”java” contentType=”text/html; charset=ISO-8859-1″
    pageEncoding=”ISO-8859-1″%>
    <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>

    <html lang=”en”>
    <head>
    <title id=’Description’>This sample demonstrates how to load Tree Items via Ajax
    </title>
    <link rel=”stylesheet” href=”D:\css\jqx.base.css” type=”text/css” />
    <script type=”text/javascript” src=”D:\js\jquery-1.11.1.min.js”></script>
    <script type=”text/javascript” src=”D:\js\demos.js”></script>
    <script type=”text/javascript” src=”D:\js\jqxcore.js”></script>
    <script type=”text/javascript” src=”D:\js\jqxbuttons.js”></script>
    <script type=”text/javascript” src=”D:\js\jqxscrollbar.js”></script>
    <script type=”text/javascript” src=”D:\js\jqxpanel.js”></script>
    <script type=”text/javascript” src=”D:\js\jqxtree.js”></script>
    <script type=”text/javascript” src=”D:\js\jqxexpander.js”></script>
    <script type=”text/javascript”>
    $(document).ready(function () {
    // Create jqxTree
    var tree = $(‘#jqxTree’);
    var source = null;
    $.ajax({
    async: false,
    url: “ajaxroot.htm”,
    success: function (data, status, xhr) {
    source = jQuery.parseJSON(data);
    }
    });
    tree.jqxTree({ source: source, height: 300, width: 200 });
    tree.on(‘expand’, function (event) {
    var label = tree.jqxTree(‘getItem’, event.args.element).label;
    var $element = $(event.args.element);
    var loader = false;
    var loaderItem = null;
    var children = $element.find(‘ul:first’).children();
    $.each(children, function () {
    var item = tree.jqxTree(‘getItem’, this);
    if (item && item.label == ‘Loading…’) {
    loaderItem = item;
    loader = true;
    return false
    };
    });
    if (loader) {
    $.ajax({
    url: loaderItem.value,
    success: function (data, status, xhr) {
    var items = jQuery.parseJSON(data);
    tree.jqxTree(‘addTo’, items, $element[0]);
    tree.jqxTree(‘removeItem’, loaderItem.element);
    }
    });
    }
    });
    });
    </script>
    </head>
    <body class=’default’>
    <div id=”jqxTree”>
    </div>
    </body>
    </html>

    Invisible Tree #78408

    zakstev
    Participant

    Controls looks nice, will it work in real time?

    Invisible Tree #78423

    zakstev
    Participant

    hi Team,

    Appreciate if you could reply to my problem.
    Thanks in advance.

    Regards,
    M.Z

    Invisible Tree #78433

    Mariya
    Participant

    Hi M.Z,

    Ajax works only with HTTP protocol so you should run any demo on a web server or Localhost. Please ensure that the all of the files paths are right as well.

    Best Wishes,
    Mariya

    jQWidgets Team
    http://www.jqwidgets.com

    Invisible Tree #78439

    zakstev
    Participant

    hi Mariya,

    I know that Ajax works only with server or localhost. I’m running local host. As i see only few controls are working on your demo!

    Invisible Tree #78440

    zakstev
    Participant

    Give me the solution on tree control and Grid, If you can solve my problem i will place my order right now.

    Invisible Tree #78441

    Mariya
    Participant

    Hi M.Z,

    All of the jqWidgets’s controls are working. The provided code is from our online demo so if the jqxTree does not appear you may have one of the following problems which are not connected with the controls.
    -your files are not referred right
    -your file with the data is not referred right
    -your web server is not configured right

    Take a look at the provided demo for jqxGrid: http://jspexamples.jqwidgets.com/examples/grid.htm?arctic

    Best Wishes,
    Mariya

    jQWidgets Team
    http://www.jqwidgets.com

    Invisible Tree #78444

    zakstev
    Participant

    Dear Mariya,

    I’m running jqwidgets-ver3.9.1 and all CSS and JS files are referred correctly and data files are also referring correctly and
    about the server I’m running Apache Tomcat which is configured and running very fine.

    Invisible Tree #78446

    Mariya
    Participant

    Hi M.Z,

    Take a look at the provided working example which is online at: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtree/ajaxloading.htm?arctic .For basic information about jqxTree you can use:http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxtree/jquery-tree-getting-started.htm

    Best Wishes,
    Mariya

    jQWidgets Team
    http://www.jqwidgets.com

    Invisible Tree #78456

    zakstev
    Participant

    hi Mariya,

    From your documentation i tried both examples as shown below.
    1) Basic Tree Sample created from UL——–>Worked but without drilldown icons in it it.
    2) Basic Tree Sample created by setting the ‘source’ property(option).—–> Not at all working.

    Please guide me with the right controls!

    Regards,
    M.Z

    Invisible Tree #78478

    Peter Stoev
    Keymaster

    Hi zakstev,

    The 2 demos which Maria sent you are online and if you click on them you will see that they work. The “source” property is set too. I suggest you to double check whether you run or not samples which have AJAX calls on a Web Server because AJAX makes HTTP calls. If you just double-click on a sample, you don’t open it on a web server or your path to the files are incorrect or something else which you should find yourself in your environment is incorrect. If you wish, look also the tutorials about using our widgets with JSP, ASP .NET or PHP and learn from there or other internet resources. This is All we can do for you.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.