Docs
API
  • addFilter(index: String, value: Mixed)


    Adds filter by index with value.

    To use this method it requires to set property filter: true

    Example

    
    var grid = new FancyGrid({
      ...
      filter: true,
      ...
    });
    
    grid.addFilter('name', 'Nick');
    

    addFilter(index: String, value: Mixed, sign: String)


    Adds filter by index with value and sign.

    List of signs available in section Filtering

    To use this method it requires to set property filter: true

    Example

    
    var grid = new FancyGrid({
      ...
      filter: true,
      ...
    });
    
    grid.addFilter('age', 30, '<');
    

    Example: Several params

    
    var grid = new FancyGrid({
      ...,
      filter: true,
      ...
    });
    
    grid.addFilter('name', ['Nick', 'Peter'], '=');
    

    Example: filtering date column

    
    var grid = new FancyGrid({
      ...,
      filter: true,
      ...
    });
    //Find items with dates less than 1-st January of 1977
    grid.addFilter('birthday', new Date(1977, 0, 1), '<');
    

    Example: filtering date column with string value.

    In FancyGrid there is help function to parse string value to date.
    It is Fancy.Date.parse('1977.07.21', 'Y.m.d');

    
    var grid = new FancyGrid({
      ...,
      filter: true,
      ...
    });
    
    //Find items with dates more than 21-st July of 1977
    grid.addFilter('birthday', Fancy.Date.parse('1977.07.21', 'Y.m.d'), '>');
    

    See also

    Method clearFilter
    Method find
    Method findItem
    Method getDataFiltered
    Method search

    Doc link Filtering