Browse Source

Merge pull request #2801 from appscode/pr

Use custom toolbar position
文翼 8 years ago
parent
commit
ef6ac2ca74
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/bootstrap-table.js

+ 7 - 1
src/bootstrap-table.js

@@ -379,6 +379,7 @@
         singleSelect: false,
         toolbar: undefined,
         toolbarAlign: 'left',
+        customToolbar: undefined,
         checkboxHeader: true,
         sortable: true,
         silentSort: true,
@@ -656,7 +657,12 @@
         this.$tableBody = this.$container.find('.fixed-table-body');
         this.$tableLoading = this.$container.find('.fixed-table-loading');
         this.$tableFooter = this.$container.find('.fixed-table-footer');
-        this.$toolbar = this.$container.find('.fixed-table-toolbar');
+        // checking if custom table-toolbar exists or not
+        if (this.options.customToolbar) {
+            this.$toolbar = $('body').find(this.options.customToolbar);
+        } else {
+            this.$toolbar = this.$container.find('.fixed-table-toolbar');
+        }
         this.$pagination = this.$container.find('.fixed-table-pagination');
 
         this.$tableBody.append(this.$el);