浏览代码

Use custom toolbar position, pass data-custom-toolbar=<class-name> form html

sajibcse68 9 年之前
父节点
当前提交
6a6e719679
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/bootstrap-table.js

+ 7 - 1
src/bootstrap-table.js

@@ -345,6 +345,7 @@
         singleSelect: false,
         toolbar: undefined,
         toolbarAlign: 'left',
+        customToolbar: undefined,
         checkboxHeader: true,
         sortable: true,
         silentSort: true,
@@ -619,7 +620,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);