如何使用tree型结构 简单使用

初次写博客  写的不好  多多见谅


@Controller
public class TreeController {
@Autowired 

private TreeService ser;

        //指定请求地址    处理中文乱码

@RequestMapping(value = "list.action",produces = {"text/json;charset=UTF-8"})
@ResponseBody
public String list(){

return JSONArray.fromObject(ser.getList()).toString();
}

}

//前台代码ztree的使用

//属性的具体在api文档中有

<script type="text/javascript">

var setting = {
//异步加载
async:{
        enable:true,//设置 zTree 是否开启异步加载模式
        url:"<%=request.getContextPath() %>/list.action"//请求后台获取数据
      },
      //复选框设置
      check: {
  enable: true,
  chkStyle : "checkbox" ,
  chkboxType: { "Y": "p", "N": "ps" },
 
    },


//field1、field2是自定义的字段,根据你的需要自己写。id,pId见名知其义,是zTree默认的两个字段名,如果跟后台传过来的字段名不符合,可以在simpleData中指定

    

data: {//加载数据
simpleData:{

          enable:true,//true / false 分别表示 使用 / 不使用 简单数据模式

          idKey:"id",//根据自己的字段进行修改
          pIdKey:"pid",
          rootPId:0 //默认根节点的值
       
},
        key:{//页面上展示数据
        name:"menu_name",
        url:"menu_url"//点击时跳转页面
        }
}

};
//创建树
$(document).ready(function(){
$.fn.zTree.init($("#treeDemo"), setting);
}
);



</script>
<body>
<h1>ztree的使用</h1>
 <ul id="treeDemo" class="ztree"></ul>

</body>


展示效果



  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
TreeTagger文本标注 附录二 TreeTagger 赋码集 (TreeTagger tagset) CC Coordinating conjunction CD Cardinal number DT Article and determiner EX Existential there FW Foreign word IN Preposition or subordinating conjunction JJ Adjective JJR Comparative adjective JJS Superlative adjective LS List item marker MD Modal verb NN Common noun, singular or mass NNS Common noun, plural NP Proper noun, singular NPS Proper noun, plural PDT Predeterminer POS Possessive ending PP Personal pronoun PP$ Possessive pronoun RB Adverb RBR Comparative adverb RBS Sup erlative adverb RP Particle SYM Symbol TO to UH Exclamation or interjection VB BE verb, base form (be) VBD Past tense verb of BE (was, were) VBG Gerund or present participle of BE verb (being) VBN Past participle of BE verb (been) VBP Present tense (other than 3rd person singular) of BE verb (am, are) VBZ Present tense (3rd person singular) of BE verb (is) VD DO verb, base form (do) VDD Past tense verb of DO (did) VDG Gerund or present participle of DO verb (doing) VDN Past participle of DO verb (done) VDP Present tense (other than 3rd person singular) of DO verb (do) VDZ Present tense (3rd person singular) of DO verb (does) VH HAVE verb, base form (have) VHD Past tense verb of HAVE (had) VHG Gerund or present participle of HAVE verb (having) VHN Past participle of HAVE verb (had) VHP Present tense (other than 3rd person singular) of HAVE verb (have) VHZ Present tense (3rd person singular) of HAVE verb (has) VV Lexical verb, base form (e.g. live) VVD Past tense verb of lexical verb (e.g. lived) VVG Gerund or present participle of lexical verb (living) VVN Past participle of lexical verb (lived, shown) VVP Present tense (other than 3rd person singular) of lexical verb (live) VVZ Present tense (3rd person singular) of lexical verb (lives) WDT Wh-determiner WP Wh-pronoun WP$ Possessive wh-pronoun WRB Wh-adverb

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值