I am appending data to a table from within an ajax callback.
// ajax
...
success: function(data) {
$("#some-table").bootgrid("append", data.rows);
},
..
It works as intended except the search.
Search works for a single letter but then throws this error on an additional characters rendering it unusable.
Uncaught TypeError: Cannot read property 'search' of null
Its coming from this function in the lib
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");
for (var i = 0; i < that.columns.length; i++)
{
column = that.columns[i];
if (column.searchable && column.visible &&
column.converter.to(row[column.id]).search(searchPattern) > -1) // this is where it breaks
{
return true;
}
}
return false;
}