Tree 2 of extjs Learning

Source: Internet
Author: User

If the generated tree has only one layer, modify the action as follows:

/** <Br/> * generate a user-managed topic tree <br/> * @ return <br/> */<br/> Public String getmymanagetype () {<br/> List <jsontreenode> treenodearray = new arraylist <jsontreenode> (); <br/> string sqlstring = "select typecode, typename from dx_fm_type where typecode in (select distinct typecode from dx_fm_atp_map where managerid = ?) Order by typecode "; <br/> string [] params1 = new string [] {userid}; </P> <p> List jsonlist = new arraylist (); <br/> List list1 = Dao. querybyparamsql (sqlstring, 0, 0, params1); <br/> If (null! = List1 & 0! = List1.size () {<br/> for (INT I = 0; I <list1.size (); I ++) {<br/> object [] OBJ = (object []) list1.get (I); <br/> string typecode = OBJ [0]. tostring (); <br/> string typename = OBJ [1]. tostring (); </P> <p> jsontreenode treenode = new jsontreenode (); <br/> treenode. setid (typecode); <br/> treenode. settext (typename); <br/> treenode. setcls ("X-HTML-Editor-tip"); <br/> treenode. setleaf (true); // note that this parameter must be set to a leaf node <br/> treenode. setexpanded (false); <br/> treenodearray. add (treenode); <br/>}< br/> jsonarray = jsonarray. fromobject (treenodearray); // obtain the JSON array <br/> jsonstring = jsonarray. tostring (); // return JSON data </P> <p> return "success"; // return JSON data <br/>}</P> <p>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.