zoukankan      html  css  js  c++  java
  • easyUI MVC3一些注意的东东

    一、在controller中,传递参数一定要用id来命名

    比如:

    public JsonResult GetItemsByCategory(string id)    
    //一定不能写为
    public JsonResult GetItemsByCategory(string category)
    //否则,在页面中如果调用此方法    

    $('#Unit').combobox({url: '@Url.Action("GetItemsByCategory", "Dic_Item")/'+"单位"});
    //就会提示找不到参数的错误

      

    二、easyUI combotree只能选择叶节点的代码: 

    $('#cc').combotree({            //获取数据URL              url: '@Url.Action("GetGoodsTypeTree", "GoodsType")',            //选择树节点触发事件              onSelect: function (node) {                //返回树对象  var tree = $(this).tree;                //选中的节点是否为叶子节点,如果不是叶子节点,清除选中  var isLeaf = tree('isLeaf', node.target);                if (!isLeaf) {                    //清除选中                      $('#cc').combotree('clear');                }            }        });

    三、easyUI tree 只能选叶节点的代码

    onBeforeSelect: function (node) {              
    //返回树对象
    if ($('#tt2').tree('isLeaf', node.target)) {
    //清除选中
    returntrue;
    }
    else return false;


    }


    四、combobox 获取用户输入数据:
         在submit前,
           $('#unit').combobox('setValue', $('#unit').combobox('getText'))

  • 相关阅读:
    hdu4998 旋转坐标系
    hdu4998 旋转坐标系
    hdu5012 水搜索
    hdu5012 水搜索
    hdu5007 小水题
    ZOJ 3645 BiliBili 高斯消元 难度:1
    ZOJ 3654 Letty's Math Class 模拟 难度:0
    ZOJ 3647 Gao the Grid dp,思路,格中取同一行的三点,经典 难度:3
    ZOJ 3646 Matrix Transformer 二分匹配,思路,经典 难度:2
    ZOJ 3644 Kitty's Game dfs,记忆化搜索,map映射 难度:2
  • 原文地址:https://www.cnblogs.com/zsanhong/p/2736706.html
Copyright © 2011-2022 走看看