Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
<tr>
<td>20</td>
<td>01</td>
<td>nulla.magna.malesuada@musProin.edu</td>
<td>[nulla.magna.malesuada@musProin.edu</td>
<td>30.01.17</td>
<td>Ac Urna Corp.</td>
<td>2</td>
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.bootgrid.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* jQuery Bootgrid v1.4.2 - 08/02/2017
* Copyright (c) 2014-2017 Rafael Staib (http://www.jquery-bootgrid.com)
* jQuery Bootgrid v1.4.2 - 05/24/2018
* Copyright (c) 2014-2018 Rafael Staib (http://www.jquery-bootgrid.com)
* Licensed under MIT http://www.opensource.org/licenses/MIT
*/
.bootgrid-header,
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.bootgrid.fa.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* jQuery Bootgrid v1.4.2 - 08/02/2017
* Copyright (c) 2014-2017 Rafael Staib (http://www.jquery-bootgrid.com)
* jQuery Bootgrid v1.4.2 - 05/24/2018
* Copyright (c) 2014-2018 Rafael Staib (http://www.jquery-bootgrid.com)
* Licensed under MIT http://www.opensource.org/licenses/MIT
*/
;(function ($, window, undefined)
Expand Down
17 changes: 11 additions & 6 deletions dist/jquery.bootgrid.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* jQuery Bootgrid v1.4.2 - 08/02/2017
* Copyright (c) 2014-2017 Rafael Staib (http://www.jquery-bootgrid.com)
* jQuery Bootgrid v1.4.2 - 05/24/2018
* Copyright (c) 2014-2018 Rafael Staib (http://www.jquery-bootgrid.com)
* Licensed under MIT http://www.opensource.org/licenses/MIT
*/
;(function ($, window, undefined)
Expand Down Expand Up @@ -87,11 +87,15 @@ function highlightAppendedRows(rows) {
}
}

function escapeRegExp(str) {
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}

// Replaces all occurrences of the word in the given html
// Original source: http://stackoverflow.com/questions/8503121/replace-words-in-a-string-but-ignore-html
function highlightResults(html) {
var that = this,
word = that.searchPhrase,
word = escapeRegExp(that.searchPhrase),
tpl = this.options.templates,
css = this.options.css,
container = document.createElement("div"),
Expand Down Expand Up @@ -189,16 +193,17 @@ response = {
}
*/



function loadData() {
var that = this;

this.element._bgBusyAria(true).trigger("load" + namespace);
showLoading.call(this);

function containsPhrase(row) {
var column,
searchPattern = new RegExp(that.searchPhrase, (that.options.caseSensitive) ? "g" : "gi");

var column;
var searchPattern = new RegExp(escapeRegExp(that.searchPhrase), (that.options.caseSensitive) ? "g" : "gi");
for (var i = 0; i < that.columns.length; i++) {
column = that.columns[i];
if (column.searchable && (column.visible || that.options.searchSettings.includeHidden) &&
Expand Down