• easyui form load 数据表单有下拉框


    (function () {
            
            $('#text1').combobox({
                url: 'http://localhost:5463/test/getComboJson'
            })
            $('#text2').combobox({
                url: 'http://localhost:5463/test/getComboJson'
            })
            $('#text3').combobox({
                url: 'http://localhost:5463/test/getComboJson'
            })
            $('#text4').combobox({
                url: 'http://localhost:5463/test/getComboJson'
            })
    
    
            $('#text5').combotree({
                url: 'http://localhost:5463/test/getTreeJson'
            })
    
    
            Public.post("http://localhost:5463/test/getFristOne", {id: 34}, function (data) {
    
    
                $('#form1').form('load', data);
    
    
            })
        })

     我让下拉框延迟加载看form会不会加载不上??

    public ActionResult getFristOne() {
    
                Dictionary<string, object> dic = new Dictionary<string, object>();
                dic.Add("text1", "1");
                dic.Add("text2", "2");
                dic.Add("text3", "3");
                dic.Add("text4", "4");
                dic.Add("text5", "5");
                //Thread.Sleep(2000);//线程挂起1000毫秒
                return Json(dic, JsonRequestBehavior.AllowGet);
            }
            public ActionResult getTreeJson() {
    
                IList<Dictionary<string, object>> List = new List<Dictionary<string, object>>();
                for (int i = 0; i < 5000; i++)
                {
                    Dictionary<string, object> dic = new Dictionary<string, object>();
                    dic.Add("id", i.ToString());
                    dic.Add("text", "项目"+i);
                    IList<Dictionary<string, string>> children = new List<Dictionary<string, string>>();               
                    dic.Add("children", new ArrayList());
                    List.Add(dic);
                }
    
                Thread.Sleep(3000);//线程挂起1000毫秒
    
                return Json(List, JsonRequestBehavior.AllowGet);
            }
    
    
            public ActionResult getComboJson()
            {
    
                IList<Dictionary<string, object>> List = new List<Dictionary<string, object>>();
                for (int i = 0; i < 5000; i++)
                {
                    Dictionary<string, object> dic = new Dictionary<string, object>();
                    dic.Add("value", i.ToString());
                    dic.Add("text", "项目" + i);
                    List.Add(dic);
                }
    
                Thread.Sleep(3000);//线程挂起1000毫秒
    
                return Json(List, JsonRequestBehavior.AllowGet);
            }

     结果加载上了。

    阅读easyui的源代码发现,这个它是根据name来反找了一下组件的实例然后调用了setValue方法

  • 相关阅读:
    SQLServer 高可用、高性能和高保护延伸
    SQLServer 通过DMV实现低影响的自动监控和历史场景追溯
    查找表包含的页和页所在的表
    出身在二三线城市软件工作者的悲哀
    SQL语句实现取消自增列属性
    基于Apache(without ssl)的svn环境搭建
    sqlite3 命令行操作
    HTML常用特殊符号集
    IOS项目目录结构和开发流程
    Mac OSX 快捷键&命令行
  • 原文地址:https://www.cnblogs.com/yeminglong/p/8044252.html
Copyright © 2020-2023  润新知