欧美日韩不卡一区二区三区,www.蜜臀.com,高清国产一区二区三区四区五区,欧美日韩三级视频,欧美性综合,精品国产91久久久久久,99a精品视频在线观看

jQuery Mobile

jquery中EasyUI同步樹(shù)的實(shí)現(xiàn)代碼

時(shí)間:2024-07-26 09:35:24 jQuery Mobile 我要投稿
  • 相關(guān)推薦

jquery中EasyUI同步樹(shù)的實(shí)現(xiàn)代碼

  在JS中,將顯示樹(shù)的url地址寫(xiě)成control的地址即可.

  代碼如下:

  @RequestMapping(value = "/tree")

  public void tree(HttpServletRequest request, HttpServletResponse response) throws IOException {

  this.writeJson(response, bookService.getTree());

  }

  dao:

  復(fù)制代碼 代碼如下:

  /**

  * 獲取樹(shù)

  */

  @Override

  public ListgetTree(){

  try {

  Listtrees = new ArrayList();

  Listroot = this.search(0);

  if(root != null && root.size() > 0){

  for(TBookType tb : root){

  Tree rootnode = this.getNode(tb);

  rootnode.setState("open");

  trees.add(rootnode);

  }

  }

  return trees;

  } catch (Exception e) {

  e.printStackTrace();

  return null;

  }

  }

  /**

  * 遞歸

  */

  private Tree getNode(TBookType node){

  if(node == null){

  return null;

  }

  try {

  Tree treenode = new Tree();

  treenode.setId(String.valueOf(node.getId()));

  treenode.setText(node.getName());

  treenode.setPid(String.valueOf(node.getPid()));

  Listchildren = this.search(node.getId());

  if(children != null && children.size() > 0){

  treenode.setState("closed");

  for(TBookType child : children){

  Tree childnode = this.getNode(child);

  if(childnode != null){

  treenode.getChildren().add(childnode);//遞歸

  }

  }

  }

  return treenode;

  } catch (Exception e) {

  throw new BusinessException("獲取數(shù)據(jù)出錯(cuò)!", e);

  }

  }

【jquery中EasyUI同步樹(shù)的實(shí)現(xiàn)代碼】相關(guān)文章:

數(shù)控編程代碼大全02-13

Java代碼的基本知識(shí)09-03

網(wǎng)頁(yè)滾動(dòng)文字的制作HTML代碼04-10

質(zhì)量管理創(chuàng)新如何實(shí)現(xiàn)05-16

如何實(shí)現(xiàn)綠色環(huán)保裝修11-02

內(nèi)部審計(jì)如何實(shí)現(xiàn)價(jià)值增值04-23

企業(yè)經(jīng)營(yíng)如何實(shí)現(xiàn)管理高效02-15

2022中層管理者在企業(yè)中的作用03-15

在word中畫(huà)圖的步驟04-22

速記培訓(xùn)中的騙術(shù)03-19