• 利用easyUI填充表格数据


    easyui tree
    后台获取json数据,根据前台需要的json数据格式建立bean
    如:
    { "id":1,
    "text":"Folder1",
    "iconCls":"icon-save",
    "children":[{
    "text":"File1",
    "checked":true }
    {
    "text":"Books",
    "state":"open",
    "attributes":{
    "url":"/demo/book/abc",
    "price":100
    },
    1. bean实体类属性 id text iconcls children(list) attributes (根据里面属性判断为map)
    2. nodecontroller
    @RequestMapping(value="myNodes", produces=MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ResponseBody
    treeNode tn=new treeNode(); tn.setid= "";tn.settext="";...
    list<treeNode> nodes=new arrayList<treeNode>();
    nodes.add(tn);//即获取到的json数据
    3.前台通过easyUI获取json数据通过树的名字,${'#mytree'}
    代码如下
    <script type="text/javascript">
    $(function(){
    //当页面加载完毕之后,初始化树
    $('#myTree').tree({
    url:'<%=basePath%>getMenu.do',
    onClick:function(node){
    alert(node.attributes.url);
    if ($('#myTree').tree('isLeaf',node.target)) {
    $("#myTabs").tabs('add',{
    title:node.text,
    href:"<%=basePath%>" + node.text,
    closable:true,
    iconCls:'icon-ok'

  • 相关阅读:
    [转载]PhotoShop性能优化
    SVN常用命令
    [转载]SVN使用教程
    MyEclipse Java Build Path详解
    MyEclipse安装后需要进行的配置
    c#中base64加密解密
    C# MD5 加密
    C# http Post 方法
    EPF与Myeclipse 增强代码自动智能提示
    汉字代码手册
  • 原文地址:https://www.cnblogs.com/lgf428/p/6086856.html
Copyright © 2020-2023  润新知