hdw
2019-01-16 b6a01d3bf1c4d2a598a0a89503637e9b9bc932f9
手机端更新单元格数据
1个文件已修改
28 ■■■■■ 已修改文件
gx_tieta/WebRoot/mobil/js/tbl.js 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/WebRoot/mobil/js/tbl.js
@@ -230,4 +230,30 @@
        $('.tbl-container table tbody tr').removeClass('active');
        $(this).addClass('active');
    });
});
});
//对mobile端数据表格进行操作
var MobileTbl = function(tbl, arrTh) {
    this.tbl = tbl;
    this.arrTh = arrTh;
};
// 定义对象的原型函数
MobileTbl.prototype = {
    setArrTh:function(arrTh) {      // 设置表格的头部数据
        this.arrTh = arrTh;
    }
    ,updateCell: function(rows, cols, value) {          // 更新指定的单元格
        var tbody = this.tbl.find('tbody');             // 获取tbody
        var tr = tbody.find('tr').eq(rows);             // 获取tr
        var td = tr.find('td').eq(cols);                // 获取td
        var th = this.arrTh[cols];                      // 列头部数据信息
        // 生成html标记字符串
        var tdHtml = '<b class="ui-table-cell-label">'+th+'</b>';
        tdHtml += value;
        // 添加内容到td
        td.html(tdHtml);
    }
};