一只会飞的白菜 2017-09-05 05:57 采纳率: 0%
浏览 728
已采纳

thead 如果数据是1,就为男生

   <table id="dg" title="用户信息"
            toolbar="#toolbar" pagination="true" idField="id"
            rownumbers="true" fitColumns="true" singleSelect="true">
        <thead>
            <tr>
                <th field="uid" width="100">编号</th>
                <th field="uname" width="100" editor="{type:'validatebox',options:{required:true}}">名字</th>
                <th field="ucard" width="100" editor="{type:'validatebox',options:{required:true}}">身份证</th>
                <th field="ugender" width="100" editor="{type:'validatebox',options:{required:true}}",sortable:true,formatter:function(value,row,index){
                        console.log(value);
                        console.log(row.ugende);
                       if(row.ugende==1){
                         return '男';
                       }else if(row.ugende==2){
                        return '女';
                       }}>性别</th>
                <th field="uphone" width="100" editor="{type:'validatebox',options:{required:true}}">电话</th>
                <th field="ucount" width="100" editor="{type:'validatebox',options:{required:true}}">人住人数</th>
            </tr>
        </thead>
    </table>

转换不了

  • 写回答

2条回答

  • Go 旅城通票 2017-09-05 06:12
    关注

    配置都搞错了,列配着用data-options。。建议用js来创建,而不是样式

    其他列同样改过来,好好看别人的示例

                  <th field="ugender" width="100" data-options="editor="{type:'validatebox',options:{required:true}}",sortable:true,formatter:function(value,row,index){
                            console.log(value);
                            console.log(row.ugende);
                           if(row.ugende==1){
                             return '男';
                           }else if(row.ugende==2){
                            return '女';
                           }}">性别</th>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型