From b6a01d3bf1c4d2a598a0a89503637e9b9bc932f9 Mon Sep 17 00:00:00 2001 From: hdw <hdw@192.168.7.127> Date: 星期三, 16 一月 2019 14:01:45 +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