From 2f2c003f65ceb6878bdbc39ea58a31dd79ecc8b9 Mon Sep 17 00:00:00 2001 From: Karson Date: Mon, 18 Dec 2017 11:03:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcommonsearch=E5=9C=A8?= =?UTF-8?q?=E5=A4=9A=E8=A1=A8=E6=A0=BC=E4=B8=8Bdatetimerange=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E5=87=BA=E7=8E=B0=E7=9A=84BUG=20=E6=96=B0=E5=A2=9ETab?= =?UTF-8?q?le.api.getrowdata=E9=80=9A=E8=BF=87=E8=A1=8C=E7=B4=A2=E5=BC=95?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A1=8C=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/js/bootstrap-table-commonsearch.js | 2 +- public/assets/js/require-backend.min.js | 10 ++++++++-- public/assets/js/require-table.js | 8 +++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/public/assets/js/bootstrap-table-commonsearch.js b/public/assets/js/bootstrap-table-commonsearch.js index b7b7e7f5..d7c39279 100644 --- a/public/assets/js/bootstrap-table-commonsearch.js +++ b/public/assets/js/bootstrap-table-commonsearch.js @@ -73,7 +73,7 @@ }; var column, index; require(['bootstrap-daterangepicker'], function () { - $(".datetimerange").each(function () { + $(".datetimerange", form).each(function () { $(this).on('apply.daterangepicker', function (ev, picker) { callback.call(picker, picker.startDate, picker.endDate); }); diff --git a/public/assets/js/require-backend.min.js b/public/assets/js/require-backend.min.js index 1c7224bc..841c2a79 100644 --- a/public/assets/js/require-backend.min.js +++ b/public/assets/js/require-backend.min.js @@ -9126,7 +9126,7 @@ return d.keepInvalid=a,l},l.datepickerInput=function(a){if(0===arguments.length) }; var column, index; require(['bootstrap-daterangepicker'], function () { - $(".datetimerange").each(function () { + $(".datetimerange", form).each(function () { $(this).on('apply.daterangepicker', function (ev, picker) { callback.call(picker, picker.startDate, picker.endDate); }); @@ -10007,7 +10007,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr title = j.title ? j.title : text; confirm = j.confirm ? 'data-confirm="' + j.confirm + '"' : ''; extend = j.extend ? j.extend : ''; - html.push('' + (text ? ' ' + text : '') + ''); + html.push('' + (text ? ' ' + text : '') + ''); } }); return html.join(' '); @@ -10053,6 +10053,12 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr // 切换复选框状态 toggleattr: function (table) { $("input[type='checkbox']", table).trigger('click'); + }, + // 根据行索引获取行数据 + getrowdata: function (table, index) { + index = parseInt(index); + var data = table.bootstrapTable('getData'); + return typeof data[index] !== 'undefined' ? data[index] : null; } }, }; diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index 150f1526..94c84cca 100644 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -438,7 +438,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table title = j.title ? j.title : text; confirm = j.confirm ? 'data-confirm="' + j.confirm + '"' : ''; extend = j.extend ? j.extend : ''; - html.push('' + (text ? ' ' + text : '') + ''); + html.push('' + (text ? ' ' + text : '') + ''); } }); return html.join(' '); @@ -484,6 +484,12 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table // 切换复选框状态 toggleattr: function (table) { $("input[type='checkbox']", table).trigger('click'); + }, + // 根据行索引获取行数据 + getrowdata: function (table, index) { + index = parseInt(index); + var data = table.bootstrapTable('getData'); + return typeof data[index] !== 'undefined' ? data[index] : null; } }, };