Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
310
How to use a separate text box field to filter a grid
posted

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>

Parents
  • 15320
    Offline posted

    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

Reply Children