浏览代码

Fix #2205

And change the code based on wen suggestions
Dennis Hernández 9 年之前
父节点
当前提交
e65c6e6ada

+ 1 - 1
src/bootstrap-table.css

@@ -196,7 +196,7 @@
     line-height: 1.428571429;
     line-height: 1.428571429;
 }
 }
 
 
-.fixed-table-toolbar .bars-bs-table,
+.fixed-table-toolbar .bs-bars,
 .fixed-table-toolbar .search,
 .fixed-table-toolbar .search,
 .fixed-table-toolbar .columns {
 .fixed-table-toolbar .columns {
     position: relative;
     position: relative;

+ 3 - 3
src/bootstrap-table.js

@@ -1032,13 +1032,13 @@
             $search,
             $search,
             switchableCount = 0;
             switchableCount = 0;
 
 
-        if (this.$toolbar.find('.bars-bs-table').children().length) {
+        if (this.$toolbar.find('.bs-bars').children().length) {
             $('body').append($(this.options.toolbar));
             $('body').append($(this.options.toolbar));
         }
         }
         this.$toolbar.html('');
         this.$toolbar.html('');
 
 
         if (typeof this.options.toolbar === 'string' || typeof this.options.toolbar === 'object') {
         if (typeof this.options.toolbar === 'string' || typeof this.options.toolbar === 'object') {
-            $(sprintf('<div class="bars-bs-table pull-%s"></div>', this.options.toolbarAlign))
+            $(sprintf('<div class="bs-bars pull-%s"></div>', this.options.toolbarAlign))
                 .appendTo(this.$toolbar)
                 .appendTo(this.$toolbar)
                 .append($(this.options.toolbar));
                 .append($(this.options.toolbar));
         }
         }
@@ -1956,7 +1956,7 @@
         }
         }
         request = $.extend({}, calculateObjectValue(null, this.options.ajaxOptions), {
         request = $.extend({}, calculateObjectValue(null, this.options.ajaxOptions), {
             type: this.options.method,
             type: this.options.method,
-            url: (url === undefined ? this.options.url : url),
+            url:  url || this.options.url,
             data: this.options.contentType === 'application/json' && this.options.method === 'post' ?
             data: this.options.contentType === 'application/json' && this.options.method === 'post' ?
                 JSON.stringify(data) : data,
                 JSON.stringify(data) : data,
             cache: this.options.cache,
             cache: this.options.cache,

+ 6 - 0
src/extensions/multiple-search/README.md

@@ -15,3 +15,9 @@ Use Plugin: [bootstrap-table-multiple-search](https://github.com/wenzhixin/boots
 * type: Boolean
 * type: Boolean
 * description: Set to true if you want to search by multiple columns. For example: if the user puts: "526 table" we are going to `split` that string and then we are going to search in all columns in the boostrap table.
 * description: Set to true if you want to search by multiple columns. For example: if the user puts: "526 table" we are going to `split` that string and then we are going to search in all columns in the boostrap table.
 * default: `false`
 * default: `false`
+
+### delimeter
+
+* type: String
+* description: Configure the delimeter of the multiple search
+* default: ` ` (whitespace)

+ 3 - 2
src/extensions/multiple-search/bootstrap-table-multiple-search.js

@@ -9,7 +9,8 @@
     'use strict';
     'use strict';
 
 
     $.extend($.fn.bootstrapTable.defaults, {
     $.extend($.fn.bootstrapTable.defaults, {
-        multipleSearch: false
+        multipleSearch: false,
+	    delimeter: " "
     });
     });
 
 
     var BootstrapTable = $.fn.bootstrapTable.Constructor,
     var BootstrapTable = $.fn.bootstrapTable.Constructor,
@@ -20,7 +21,7 @@
             if (this.searchText === undefined) {
             if (this.searchText === undefined) {
                 return;
                 return;
             }
             }
-            var strArray = this.searchText.split(" "),
+            var strArray = this.searchText.split(this.options.delimeter),
                 that = this,
                 that = this,
                 f = $.isEmptyObject(this.filterColumns) ? null : this.filterColumns,
                 f = $.isEmptyObject(this.filterColumns) ? null : this.filterColumns,
                 dataFiltered = [];
                 dataFiltered = [];