zoukankan      html  css  js  c++  java
  • formatter easyui 重命名

    function for_method(){
        datagridmethod = $('#formethod_datagrid').datagrid({
                url : 'localforecast_select',
                iconCls : 'icon-tabgrid',
                pagination : true,
                pagePosition : 'bottom',
                pageSize : 10,
                pageList : [ 10, 20, 30, 40 ],
                striped : true,
                fit : true,
                fitColumns : true,
                nowrap : false,
                border : true,
                singleSelect : true,
                idField : 'id',
                sortName : 'id',
                sortOrder : 'desc',
                rownumbers : true,
                frozenColumns : [ [ {
                    title : '编号',
                    field : 'id',
                    width : 150,
                    sortable : true,
                    checkbox : true
                }] ],
                columns : [ [{
                    title : '上传时间',
                    field : 'fileTime',
                    width : 60

                },{
                    title : '文件名称',
                    field : 'fileName',
                    width : 50

                },  {
                    title : '文件类型',
                    field : 'fileType',
                    width : 60
                },{
                    title : '文件大小',
                    field : 'fileSize',
                    width : 60,
                },{
                    title : '上传人',
                    field : 'fileAuthor',
                    width : 60
                },{
                    title : '类型',
                    field : 'type',
                    width : 60,
                    formatter : function(value,rowData,rowIndex){
                        var values = '';
                        if(value == "0"){
                            values +="预报指标";
                        }else if(value=="1"){
                            values+="技术流程";
                        }else if(value=="2"){
                            values+="统计分析";
                        }else if(value=="3"){
                            values+="其它";
                        }
                        return values;
                    }
                },{
                    title : '要素',
                    field : 'elements',
                    width : 60,
                },{
                    title : '操作',
                    field : 'filePaht',
                    width :100,
                    //添加超级链
                    formatter:function(value,rowData,rowIndex){
                        //function里面的三个参数代表当前字段值,当前行数据对象,行号(行号从0开始)
                        var fileNames;
                        var fileUrls;
                        var filetypes;
                        if(rowData.fileName){
                            fileNames = rowData.fileName.split(',');
                        }
                        if(rowData.fileType){
                            filetypes = rowData.fileType.split(',');
                        }
                       if(rowData.filePath){
                            fileUrls = rowData.filePath.split(',');
                        }
                        var values = '';
                        if(fileNames){
                            for(var k = 0;k<fileNames.length;k++){
                                values += "<a href="javascript:void(0)"onclick="dowloadFile('"+fileNames[k]+"."+filetypes[k]+"','"+fileUrls[k]+"')">下载</a>&nbsp;&nbsp;&nbsp;";
                            }
                        }
                        return values;
                   }  
                }] ],
                onDblClickRow : function(rowIndex, rowData){
                    //resetContent('addAndEditForm');
                    //edit();
                }
            });
    }

  • 相关阅读:
    九度OJ 1010 A+B
    九度OJ 1052 找x
    oracle数据库创建备份与恢复 脚本
    在select标签中添加a标签
    如何在select标签中使用a标签跳转页面
    网站访问不了
    js实现input的赋值
    PHP如何实现百万级数据导出
    互联网产品需求管理杂思2需求收集,互联网营销 狼人:
    做网站用UTF8还是GB2312?,互联网营销 狼人:
  • 原文地址:https://www.cnblogs.com/guolsblog/p/6015585.html
Copyright © 2011-2022 走看看