EasyUI Forum
November 06, 2025, 05:00:44 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Can not get tree to work with json  (Read 12190 times)
terjeber
Newbie
*
Posts: 4


View Profile Email
« on: March 13, 2013, 12:49:35 AM »

In my head I have
        <script src="/js/jquery-1.8.2.js"></script>
        <script src="/js/modernizr-2.6.2.js"></script>
        <script src="/js/jquery-easyui-1.3.2/jquery.easyui.min.js"></script>

In my body I have one ul looking like this:

Code:
<ul id="tt1" class="easyui-tree">
<li data-options="state:'closed'"><span>One</span>
    <ul>
            <li data-options="state:'closed'"><span>One-One</span>
                <ul>
                        <li><span>One-one-one</span></li>

etc... this works fine.

Below that I have another ul as so:

Code:
<ul id="tt2" class="easyui-tree" data-options="url: '../api/getTreeStuff'"></ul> 

This doesn't work at all. The api/getTreeStuff is never called. I have also tried doing the same on a page load using jQuery, no dice. I can not get this to work at all. I have also tried to simply load the pages that ship with 1.3.2 under demo, and none of the ones using json to load stuff into a tree work. They do not work if I just open the page from disk nor do they work when I put them into a webpage.

Please note, if I add the following to my page, the api/getTreeStuff is called no problem. Why is easyui not calling the javascript?
Code:
<script type="text/javascript" src="../api/getTreeStuff"></script>

I have tried with all kinds of URLs, from ../api/xxxxx through /api/xxxxxxx to http://thebloodyserver/api/xxxxxxx

What am I doing wrong? Any ideas?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: March 13, 2013, 02:27:06 AM »

Please refer to this example http://www.jeasyui.com/tutorial/tree/tree2.php.
Logged
terjeber
Newbie
*
Posts: 4


View Profile Email
« Reply #2 on: March 14, 2013, 04:50:04 AM »


Doesn't work. The server side code is never called.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!