zoukankan      html  css  js  c++  java
  • asp.net mvc 之jqgird 列表数据 根据字典显示中文

     colModel: [
     
                    {
                        name: "status", label: "状态", 70, align: "left",
                        formatter: function (cellvalue, options, rowObject) {
                           if (!!cellvalue) {
                                var v = cellvalue;
                                $.ajax({
                                    url: "../../OpticManage/Cable/GetItemName",
                                    data: { ItemId: "50415", keyValue: cellvalue },
                                    async: false,
                                    success: function (data) {
                                        v = data;
                                    }
                                });
                                return v;
                            } else {
                                return "";
                            }
                        }
                    },
     ],

    Controller层  keyValue 是数据库存储的编号,ItemId是父编号
            [HttpGet]
            public ActionResult GetItemName(string keyValue, string ItemId)
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendFormat("select ItemName from Base_DataItemDetail where ItemId='{0}' and ItemValue={1}", ItemId,keyValue);
                string itemname= dbbase.getValue(sb.ToString());
                return Content(itemname);
            }

     

  • 相关阅读:
    Eclipse安装常用离线插件
    Eclipse添加Maven、Jdk、Tomcat
    每天总结模电-去耦电容(一)
    4K显示器含义
    c语言的学习方法
    悲伤逆流成河读后感
    晶体管(三极管,场效应管,MOS以及CMOS)的区别
    强电的元器件认识
    ElasticSearch
    DataGrip
  • 原文地址:https://www.cnblogs.com/gxwa/p/9511281.html
Copyright © 2011-2022 走看看