| | |
| | | $('.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);
|
| | | }
|
| | | }; |