Filter function

jQuery filter function

Easy filter a list with the jQuery filter function:

    $("#btnZoek").click(function () {
        var zoekText = $("#txtZoek").val();
        if (zoekText != '') {
            klantenList = klantenList.filter(function (val) {
                return val.Name == zoekText;

First get the string to filter for in the zoekText variable, use this in the anomous filter function to compare with the supplied value and return a bool. After this the list is filled with the found results and the ConsumeKlanten used binds the Ui to this list.




Saving your comment....

Naam is verplicht!
Email is verplicht!
Opmerking is verplicht!