zoukankan      html  css  js  c++  java
  • easyui datagrid columns field 如何支持一个或多个子属性

      

    //如果只需要一个子属性从value出发
    {field:'customer',title:'会员手机',100, formatter: function(value,row,index){ if (value.phone){ return value.phone; } else { return ''; } } },


    //如果需要多个子属性同时显示(customer为一个类)从row出发
    //自定义该类下属性name为customerName
    {field:'customerName',title:'昵称',100,
                formatter: function(value,row,index){
                    if (row.customer){
                        if(row.customer.name != '')
                            return row.customer.name;
                        else{
                            return '';
                        }
                    } else {
                        return '';
                    }
               }
            },
    //自定义该类下属性sex为customerSex
     {field:'inventorySex',title:'性别',100,
                formatter: function(value,row,index){
             if (row.customer){
                        if(row.customer.sex!= '')
                            return row.customer.sex;
                        else{
                            return '';
                        }
                    } else {
                        return '';
                    }

               }
            },
  • 相关阅读:
    Request Validation in ASP.NET
    ANSI、Unicode、Unicode big endian、UTF8编码
    在win7下安装SQL sever2005
    配置SQL Server 2005 以允许远程连接
    传统网站与Web标准——DIV+CSS布局实例
    打造自己的reset.css
    传统网站与Web标准——表格布局实例
    每天工作4小时的程序员
    良好的XHTML规则
    列表导航栏实例(02)——精美电子商务网站赏析
  • 原文地址:https://www.cnblogs.com/linvan/p/6179090.html
Copyright © 2011-2022 走看看