column filtering

column filtering

achoacho Posts: 2Questions: 0Answers: 0
edited February 2012 in General
I'm looking to apply the default filter on a set of columns and a custom filter without the default filter on another set of columns. Eg, I want to use the default filter on a column with names and a custom range filter for numerical values. How can this be accomplished?

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    To apply a default filter on columns you can use the http://datatables.net/ref#aoSearchCols initialisation option - you'll need to build the array up based on your table's configuration and which columns you want to have what defaults, but that's the parameter to use.

    Allan
  • achoacho Posts: 2Questions: 0Answers: 0
    Hi Allan, thanks for the response. I think I need some further clarification. I have two columns that use a range filter (basically >=min) and two columns that use the default string matching filter. I have pushed two range filtering functions into afnFiltering (hardcoded the specific column numbers for range filtering) and assigned a jQuery change event to call fnFilter('',column#). Although everything seems to work properly (range and string filters used on appropriate columns) I was wondering if there a) a way to explicitly call which filter function to use with the event handler, and b) how I can access the column # within my custom filter when fnFilter is called. Thanks!
This discussion has been closed.