miniui dataGrid drawcell事件

时间:2024-03-11 21:37:29

 var grid = mini.get("tpaTotal2_grid");
        //grid.load();
        //单元格绘制事件
        grid.on("drawcell",function(e){
             var record = e.record,
             column = e.column,
             field = e.field,
             value = e.value;
               if (field == "zf"||field == "df11"||field == "df12"||field == "df13"||field == "df14"||field == "df15"||field == "df16"||field == "df17"||field == "df18"||field == "df19"||field == "df20"||field == "df21") {
                   e.cellStyle = "text-align:center";
                   e.cellHtml = \'<a href="javascript:showDetail(\\'\' + record.id + \'\\',\\'\' + record.dateKey + \'\\',\\'\' + record.dwdm + \'\\',\\'\' + record.teamid + \'\\')" style="text-decoration:none;">\' +value+ \'</a>&nbsp; \';
               }
        });
        //详情方法
        function showDetail(id,dateKey,dwdm,teamid){
            mini.open({
                url: "<%=basePath%>view/grjx/tpaGrjx_xq.jsp",
                title: "绩效分数详情",
                width: 1200,
                height: 400,
                onload: function () {
                    var iframe = this.getIFrameEl();
                    var data = { action: "detail",id: id,dateKey: dateKey,dwdm: dwdm,teamid: teamid};
                    iframe.contentWindow.loadData(data);
                },
                ondestroy: function (action) {
                }
            });
        }