|
|
@@ -752,16 +752,18 @@ The table options are defined in `jQuery.fn.bootstrapTable.defaults`.
|
|
|
|
|
|
- **Detail:**
|
|
|
|
|
|
- The custom search function is executed instead of built-in search function, takes one parameters:
|
|
|
+ The custom search function is executed instead of built-in search function, takes two parameters:
|
|
|
|
|
|
+ * `data`: the table data.
|
|
|
* `text`: the search text.
|
|
|
|
|
|
Example usage:
|
|
|
|
|
|
{% highlight javascript %}
|
|
|
- function customSearch(text) {
|
|
|
- //Search logic here.
|
|
|
- //You must use `this.data` array in order to filter the data. NO use `this.options.data`.
|
|
|
+ function customSearch(data, text) {
|
|
|
+ return data.filter(function (row) {
|
|
|
+ return row.field.indexOf(text) > -1
|
|
|
+ })
|
|
|
}
|
|
|
{% endhighlight %}
|
|
|
|