diff --git a/src/jsgrid.core.js b/src/jsgrid.core.js index 51bcd1d3..07c01a8b 100755 --- a/src/jsgrid.core.js +++ b/src/jsgrid.core.js @@ -925,6 +925,9 @@ }); return this._controllerCall("loadData", filter, function(loadedData) { + if(!loadedData) + return; + this._loadStrategy.finishLoad(loadedData); this._callEventHandler(this.onDataLoaded, { diff --git a/tests/jsgrid.tests.js b/tests/jsgrid.tests.js index 907d3580..1034a1a0 100755 --- a/tests/jsgrid.tests.js +++ b/tests/jsgrid.tests.js @@ -529,6 +529,26 @@ $(function() { equal(grid.option("data").length, 2, "data filtered"); }); + test("filtering with static data should not do actual filtering", function() { + var $element = $("#jsGrid"), + gridOptions = { + filtering: true, + fields: [ + { type: "text", name: "field" } + ], + data: [ + { name: "value1" }, + { name: "value2" } + ] + }, + grid = new Grid($element, gridOptions); + + grid._filterRow.find("input").val("1"); + + grid.search(); + equal(grid.option("data").length, 2, "data is not filtered"); + }); + module("nodatarow");