Trigger an event before filtering

Trigger an event before filtering

RagingTrollRagingTroll Posts: 34Questions: 3Answers: 0

It would be great if an event like 'preSearch' is triggered before filtering takes place (in the _fnFilterComplete function), in case we have a custom filter that needs something cached in order to filter each row.

Example for the preSearch event: fetch all input values from a form and save the values for row filtering.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,573Questions: 1Answers: 10,483 Site admin
    Answer ✓

    in 1.10.1 (soon to be released) I've added a couple of extra parameters to what is sent to the custom filtering function: source.

    Of particular interest is the last parameter, the list counter. So now what you can do in your filtering function is simply add if ( counter === 0 ) { ... } and do the init logic there. That way your customer filter code is still self contained.

    Allan

This discussion has been closed.