JAVAEE工程笔记5

Wesley13
• 阅读 603

JAVAEE工程笔记5

HTML

    <div size="240" showCollapseButton="true">
        <div class="mini-panel" title="业务地区查询" iconCls="icon-add" style="width:100%;height:100%;" showToolbar="false" showFooter="true">
            
            <div class="mini-toolbar" style="text-align:center;line-height:30px;" borderStyle="border-left:0;border-top:0;border-right:0;">
                  <label >名称:</label>
                  <input id="key" class="mini-textbox" style="width:100px;" onenter="onKeyEnter"/>
                  <a class="mini-button" style="width:60px;" onclick="searchTree()">查询</a>
            </div>
            <div class="mini-fit">
                <ul id="tree1" class="mini-tree" style="width:100%;height:100%;" dataField="areas" showTreeIcon="true" textField="name" 
                       idField="id" parentField="parentId" resultAsTree="false"  url="/area.do?method=paramListByParentIdAndId"
                    contextMenu="#treeMenu" expandOnLoad="0">
                </ul>
                <ul id="treeMenu" class="mini-contextmenu"  onbeforeopen="onBeforeOpen">        
                    <li  iconCls="icon-add" onclick="addNode()">新增节点</li>
                    <li iconCls="icon-edit"  onclick="editNode()">编辑节点</li>
                    <li  iconCls="icon-remove" onclick="removeNode()">禁用</li>        
                </ul>
            </div>
         </div>    
     </div>    

JS

tree.on("nodeselect", function (e) {
    var node = e.node;
    var isLeaf = e.isLeaf;
    if (isLeaf) {
        showTab(node);
    }else{
         var thisnode = tree.getSelectedNode();
         var parentId = thisnode.id
         grid.load({parentId: parentId});
    }
});

function searchTree() {
 
    var key = mini.get("key").getValue();
    if(key == ""){
         tree.clearFilter();
         tree.collapseAll ();
    }else{
        key = key.toLowerCase();
        tree.filter(function (node) {
            var text = node.name ? node.name.toLowerCase() : "";
            tree.expandAll ();
            if (text.indexOf(key) != -1) {
                return true;
            }
        });
    }
}

controller

/**
     * @title 地区树列表数据
     * @author wangyu
     * @data 2017-03-10
     */

    public ModelAndView paramListByParentIdAndId(HttpServletRequest request,
            HttpServletResponse response) {
        List<Area> list = areaManager.getParamListByParentIdAndId();
        this.renderText(response, JSONArray.fromObject(list).toString());
        return null;
    }

manager

    /**
     * 取对应的对象
     * 
     * @return
     */
    public List<Area> getParamListByParentIdAndId() {
        Criteria criteria = this.getCriteria();
        return criteria.list();
    }
点赞
收藏
评论区
推荐文章
待兔 待兔
2个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Easter79 Easter79
2年前
svg图片转字符
1.进入 https://icomoon.io官网。2.点击按钮!(https://static.oschina.net/uploads/space/2017/1228/151443_BUtm_3040505.png)3.点击添加svg图片!(https://static.oschina.net/uploads/space/2017
Wesley13 Wesley13
2年前
java——20171121
!(http://a.51jsoft.com/uploads/default/original/1X/c542896b094a42a5653fb75adf6cdacd6e35d12e.png)!(https://static.oschina.net/uploads/space/2017/1121/210719_G80Z_3715033.png)
Wesley13 Wesley13
2年前
CRM部署架构图
!(https://static.oschina.net/uploads/space/2017/0905/105311_jmrM_2745752.jpeg)!(https://static.oschina.net/uploads/space/2017/0905/105326_6WfL_2745752.png)系统部署在AWSVP
Easter79 Easter79
2年前
SpringMVC+MongoDB+Maven整合(微信回调Oauth授权)
!(https://static.oschina.net/uploads/space/2017/0608/101116_IFgH_1444646.png)!(https://static.oschina.net/uploads/space/2017/0608/101131_5yQk_1444646.jpg)个人小程序。里面是基于百度大脑腾讯优图
Wesley13 Wesley13
2年前
7月_C++_3
!(https://static.oschina.net/uploads/space/2017/0731/100449_Mgyw_3244697.png)!(https://static.oschina.net/uploads/space/2017/0731/100659_FzL9_3244697.png)!(https://static
Stella981 Stella981
2年前
MapReduce
                                  分而治之!(https://static.oschina.net/uploads/space/2017/0417/104504_gz45_3253987.png)!(https://static.oschina.net/uploads/space/2017/0417/104
Wesley13 Wesley13
2年前
JDK 1.8.0_144 集合框架之HashMap
!(https://static.oschina.net/uploads/space/2017/0807/111713_2SnR_2447963.png)1: Node的设计 静态内部类,该类是能够被继承的。!(https://static.oschina.net/uploads/space/2017/0807/111846_POJR
Wesley13 Wesley13
2年前
Java使用QQ邮箱给其他邮箱发邮件
!(https://static.oschina.net/uploads/space/2017/0930/085551_4q4k_1444646.png)!(https://static.oschina.net/uploads/space/2017/0930/085601_OveM_1444646.jpg)个人微信小程序可以扫码体验
Wesley13 Wesley13
2年前
JDK1.8新特性之类工厂、迭代循环应用
1创建实体类Person!(https://static.oschina.net/uploads/space/2017/1220/095547_B682_2313055.png)2创建工厂接口PersonFactory!(https://static.oschina.net/uploads/space/2017/1220/095711