zoukankan      html  css  js  c++  java
  • 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方法

  • 相关阅读:
    mongodb索引 单键索引
    索引 _id
    mongodb索引简介
    mongodb的基本操作之数据创建索引
    mongodb的基本操作之数据删除
    mongoDB的基本操作之数据更新多条数据
    mongodb的基本操作之更新不存在的数据
    mongoDB的基本操作之数据更新
    mongodb的基本操作之数据写入和查询
    连接mongodb服务器
  • 原文地址:https://www.cnblogs.com/yeminglong/p/8044252.html
Copyright © 2011-2022 走看看