From deab7d04e83c1eada95ff1474b4fe272b907a06f Mon Sep 17 00:00:00 2001 From: D:/workspace/chenjingjing/git/gx_tieta/gx_tieta/.gitignore <chenjingjing@LAPTOP-E51P2139> Date: 星期三, 16 一月 2019 16:31:19 +0800 Subject: [PATCH] 修改 --- gx_tieta/WebRoot/mobil/js/tbl.js | 28 +++++++++++++++++++++++++++- 1 files changed, 27 insertions(+), 1 deletions(-) diff --git a/gx_tieta/WebRoot/mobil/js/tbl.js b/gx_tieta/WebRoot/mobil/js/tbl.js index 26d3922..5f6b8f3 100644 --- a/gx_tieta/WebRoot/mobil/js/tbl.js +++ b/gx_tieta/WebRoot/mobil/js/tbl.js @@ -230,4 +230,30 @@ $('.tbl-container table tbody tr').removeClass('active'); $(this).addClass('active'); }); -}); \ No newline at end of file +}); + +//瀵筸obile绔暟鎹〃鏍艰繘琛屾搷浣� +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; + + // 娣诲姞鍐呭鍒皌d + td.html(tdHtml); + } +}; \ No newline at end of file -- Gitblit v1.9.1