修复commonsearch在多表格下datetimerange可能出现的BUG
新增Table.api.getrowdata通过行索引获取行数据
正在显示
3 个修改的文件
包含
16 行增加
和
4 行删除
@@ -73,7 +73,7 @@ | @@ -73,7 +73,7 @@ | ||
73 | }; | 73 | }; |
74 | var column, index; | 74 | var column, index; |
75 | require(['bootstrap-daterangepicker'], function () { | 75 | require(['bootstrap-daterangepicker'], function () { |
76 | - $(".datetimerange").each(function () { | 76 | + $(".datetimerange", form).each(function () { |
77 | $(this).on('apply.daterangepicker', function (ev, picker) { | 77 | $(this).on('apply.daterangepicker', function (ev, picker) { |
78 | callback.call(picker, picker.startDate, picker.endDate); | 78 | callback.call(picker, picker.startDate, picker.endDate); |
79 | }); | 79 | }); |
@@ -9126,7 +9126,7 @@ return d.keepInvalid=a,l},l.datepickerInput=function(a){if(0===arguments.length) | @@ -9126,7 +9126,7 @@ return d.keepInvalid=a,l},l.datepickerInput=function(a){if(0===arguments.length) | ||
9126 | }; | 9126 | }; |
9127 | var column, index; | 9127 | var column, index; |
9128 | require(['bootstrap-daterangepicker'], function () { | 9128 | require(['bootstrap-daterangepicker'], function () { |
9129 | - $(".datetimerange").each(function () { | 9129 | + $(".datetimerange", form).each(function () { |
9130 | $(this).on('apply.daterangepicker', function (ev, picker) { | 9130 | $(this).on('apply.daterangepicker', function (ev, picker) { |
9131 | callback.call(picker, picker.startDate, picker.endDate); | 9131 | callback.call(picker, picker.startDate, picker.endDate); |
9132 | }); | 9132 | }); |
@@ -10007,7 +10007,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr | @@ -10007,7 +10007,7 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr | ||
10007 | title = j.title ? j.title : text; | 10007 | title = j.title ? j.title : text; |
10008 | confirm = j.confirm ? 'data-confirm="' + j.confirm + '"' : ''; | 10008 | confirm = j.confirm ? 'data-confirm="' + j.confirm + '"' : ''; |
10009 | extend = j.extend ? j.extend : ''; | 10009 | extend = j.extend ? j.extend : ''; |
10010 | - html.push('<a href="' + url + '" class="' + classname + '" ' + (confirm ? confirm + ' ' : '') + extend + ' title="' + title + '" data-table-id="' + (table ? table.attr("id") : '') + '" data-column-index="' + columnIndex + '" data-button-index="' + i + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>'); | 10010 | + html.push('<a href="' + url + '" class="' + classname + '" ' + (confirm ? confirm + ' ' : '') + extend + ' title="' + title + '" data-table-id="' + (table ? table.attr("id") : '') + '" data-column-index="' + columnIndex + '" data-row-index="' + index + '" data-button-index="' + i + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>'); |
10011 | } | 10011 | } |
10012 | }); | 10012 | }); |
10013 | return html.join(' '); | 10013 | return html.join(' '); |
@@ -10053,6 +10053,12 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr | @@ -10053,6 +10053,12 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr | ||
10053 | // 切换复选框状态 | 10053 | // 切换复选框状态 |
10054 | toggleattr: function (table) { | 10054 | toggleattr: function (table) { |
10055 | $("input[type='checkbox']", table).trigger('click'); | 10055 | $("input[type='checkbox']", table).trigger('click'); |
10056 | + }, | ||
10057 | + // 根据行索引获取行数据 | ||
10058 | + getrowdata: function (table, index) { | ||
10059 | + index = parseInt(index); | ||
10060 | + var data = table.bootstrapTable('getData'); | ||
10061 | + return typeof data[index] !== 'undefined' ? data[index] : null; | ||
10056 | } | 10062 | } |
10057 | }, | 10063 | }, |
10058 | }; | 10064 | }; |
@@ -438,7 +438,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table | @@ -438,7 +438,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table | ||
438 | title = j.title ? j.title : text; | 438 | title = j.title ? j.title : text; |
439 | confirm = j.confirm ? 'data-confirm="' + j.confirm + '"' : ''; | 439 | confirm = j.confirm ? 'data-confirm="' + j.confirm + '"' : ''; |
440 | extend = j.extend ? j.extend : ''; | 440 | extend = j.extend ? j.extend : ''; |
441 | - html.push('<a href="' + url + '" class="' + classname + '" ' + (confirm ? confirm + ' ' : '') + extend + ' title="' + title + '" data-table-id="' + (table ? table.attr("id") : '') + '" data-column-index="' + columnIndex + '" data-button-index="' + i + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>'); | 441 | + html.push('<a href="' + url + '" class="' + classname + '" ' + (confirm ? confirm + ' ' : '') + extend + ' title="' + title + '" data-table-id="' + (table ? table.attr("id") : '') + '" data-column-index="' + columnIndex + '" data-row-index="' + index + '" data-button-index="' + i + '"><i class="' + icon + '"></i>' + (text ? ' ' + text : '') + '</a>'); |
442 | } | 442 | } |
443 | }); | 443 | }); |
444 | return html.join(' '); | 444 | return html.join(' '); |
@@ -484,6 +484,12 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table | @@ -484,6 +484,12 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table | ||
484 | // 切换复选框状态 | 484 | // 切换复选框状态 |
485 | toggleattr: function (table) { | 485 | toggleattr: function (table) { |
486 | $("input[type='checkbox']", table).trigger('click'); | 486 | $("input[type='checkbox']", table).trigger('click'); |
487 | + }, | ||
488 | + // 根据行索引获取行数据 | ||
489 | + getrowdata: function (table, index) { | ||
490 | + index = parseInt(index); | ||
491 | + var data = table.bootstrapTable('getData'); | ||
492 | + return typeof data[index] !== 'undefined' ? data[index] : null; | ||
487 | } | 493 | } |
488 | }, | 494 | }, |
489 | }; | 495 | }; |
-
请 注册 或 登录 后发表评论