zoukankan      html  css  js  c++  java
  • datagrid在MVC中的运用08-实现Master-Detail(使用子datagrid)

    本文主要通过一个子datagrid来实现主次表。谢谢Kevin的博文。

    代码部分与http://www.cnblogs.com/darrenji/p/3576258.html相似,这里只列出不一样的地方。

    最终效果:

    主次表datagrid

      ProductController  让子表Product返回json字符串

            public ActionResult GetJsonByCategory(int? categoryId = null)
            {
                if (!categoryId.HasValue)
                {
                    return new EmptyResult();
                }
     
                var service = new Service();
                var products = service.LoadProductsByCategory((int)categoryId);
     
                //把Products集合对象实例序列化成json字符串
                string str = JsonSerializeHelper.SerializeToJson(products);
                return Content(str);
            }

      /Category/Index视图

    展开

  • 相关阅读:
    5.6 Go 常用函数
    5.5 Go defer
    5.4 Go 闭包
    5.3 Go 匿名函数
    5.2 Go 包与函数
    python 通过pytz模块进行时区的转换,获取指定时区的时间
    前端在js中获取用户所在地区的时间与时区
    Python2 指定文件编码格式需要注意的地方
    linux 使用进程管理工具 supervisor
    Python 私有变量中两个下划线 _ _item 与 一个下划线的区别 _item
  • 原文地址:https://www.cnblogs.com/darrenji/p/3576337.html
Copyright © 2011-2022 走看看