8000 Fix #964: Added and methods. · coderabsolute/bootstrap-table@a16b087 · GitHub
[go: up one dir, main page]

Skip to content

Commit a16b087

Browse files
committed
Fix wenzhixin#964: Added and methods.
1 parent 6410da3 commit a16b087

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
- [enh] Improved reorder-columns extension.
2727
- [enh] Added multiple-search, accent-neutralise extension.
2828
- [enh] Added fixed-columns extension.
29+
- [enh] Added `$.fn.bootstrapTable.utils` tools.
30+
- [enh] Added `expandRow` and `collapseRow` methods.
2931

3032
### 1.8.1
3133

src/bootstrap-table.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2478,6 +2478,20 @@
24782478
this.onSearch({currentTarget: $search});
24792479
};
24802480

2481+
BootstrapTable.prototype.expandRow = function (index) {
2482+
var $tr = this.$body.find(sprintf('> tr[data-index="%s"]', index));
2483+
if (!$tr.next().is('tr.detail-view')) {
2484+
$tr.find('> td > .detail-icon').click();
2485+
}
2486+
};
2487+
2488+
BootstrapTable.prototype.collapseRow = function (index) {
2489+
var $tr = this.$body.find(sprintf('> tr[data-index="%s"]', index));
2490+
if ($tr.next().is('tr.detail-view')) {
2491+
$tr.find('> td > .detail-icon').click();
2492+
}
2493+
};
2494+
24812495
// BOOTSTRAP TABLE PLUGIN DEFINITION
24822496
// =======================
24832497

@@ -2504,7 +2518,8 @@
25042518
'togglePagination',
25052519
'toggleView',
25062520
'refreshOptions',
2507-
'resetSearch'
2521+
'resetSearch',
2522+
'expandRow', 'collapseRow'
25082523
];
25092524

25102525
$.fn.bootstrapTable = function (option) {

0 commit comments

Comments
 (0)
0