|
@@ -70,6 +70,12 @@
|
|
|
var $rightToolbar = $('<div class="btn-group tool-right">');
|
|
|
$toolbar.append($rightToolbar);
|
|
|
target.parent().before($toolbar);
|
|
|
+
|
|
|
+ if (options.showSearch) {
|
|
|
+ var $searchBtn = $('<button class="btn btn-default btn-outline" type="button" aria-label="search" title="搜索"><i class="glyphicon glyphicon-search"></i></button>');
|
|
|
+ $rightToolbar.append($searchBtn);
|
|
|
+ registerSearchBtnClickEvent($searchBtn);
|
|
|
+ }
|
|
|
|
|
|
if (options.showRefresh) {
|
|
|
var $refreshBtn = $('<button class="btn btn-default btn-outline" type="button" aria-label="refresh" title="刷新"><i class="glyphicon glyphicon-repeat"></i></button>');
|
|
@@ -358,6 +364,12 @@
|
|
|
});
|
|
|
return $tr;
|
|
|
}
|
|
|
+
|
|
|
+ var registerSearchBtnClickEvent = function(btn) {
|
|
|
+ $(btn).off('click').on('click', function () {
|
|
|
+ $(".search-collapse").slideToggle();
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
var registerRefreshBtnClickEvent = function(btn) {
|
|
|
$(btn).off('click').on('click', function () {
|
|
@@ -684,6 +696,7 @@
|
|
|
toolbar: null,
|
|
|
height: 0,
|
|
|
showTitle: true,
|
|
|
+ showSearch: true,
|
|
|
showColumns: true,
|
|
|
showRefresh: true,
|
|
|
expanderExpandedClass: 'glyphicon glyphicon-chevron-down',
|