I'm trying to filter a grid on a single column using input from a separate text field. Please see the code shown below. The function fires, the filter "x" is set as expected but the grid is not filtered.
<div id="wb_sbSourceCharacteristicValues" style="position:absolute;left:30px;top:89px;width:400px;height:48px;z-index:4;"><script>function lstSourceCharacteristicValuesSearch() { var x = document.getElementById("sbSourceCharacteristicValues").value; $(".lstSourceCharacteristicValues_table").igGridFiltering("destroy"); $(".lstSourceCharacteristicValues_table").igGridFiltering("filter", ([{fieldName: "lookup_display", expr: x, cond: "contains"}]));}</script><div id="sbSourceCharacteristicValueslstSourceCharacteristicValues" style="position:abosolute; left:50px; top:625px; width:400px; height:48px; z-index:4;" class="SearchBox"><input type="text" id="sbSourceCharacteristicValues" onkeyup="lstSourceCharacteristicValuesSearch()"></div></div></div>
Hello Stephen,
I noticed that you're destroying the Filtering before calling the "filter" API method, which means that once destroyed the feature does not exist anymore and could not be used further. Please note that features can be only destroyed at runtime, however they cannot be re-created after that. Adding features to the grid needs the grid to be re-created. Regarding your scenario, I would suggest you to look at the following sample, which demonstrates how to filter the grid using external input field: http://www.igniteui.com/grid/grid-api-events
If you have any further questions, please let me know.
Regards,
Tsanna
Tsana,
Thank you for the feedback. I figured out that destroy wasn't what I wanted shortly after making the above post. What I really wanted to do was clear the filter instead of destroy.
$("#gridref").igGridFiltering("filter", "");
Thank you for your feedback.
If I can provide you with further assistance, please let me know.