Git Product home page Git Product logo

ember-filter's Introduction

Ember-filter

WillFilter addon for ember with data. Its provides the filter method on store to fetch the from server.

Installation

  • ember install ember-filter

Example

If you need to filter the People, lets define the filter as PeopleFilter with filterOptions as shown bellow

#PeopleFilter.js

#This can be fetched from server as async or constant.  For each FilterOption you can define custom `componentTemplate`
# For each filter option we can define visible to force show even if there are no values.
# TO show all filter options we can use allFIlterOptions-tru while rendering ember-filter-form
# to have custome element component, which will get filter as filter, options as filterOptions an key as FilterOptionKey(status)
filterOptions: computed(function(){
  return {
    status: { operator: 'is_in', type: 'selectize', label: 'People Status', visible: true },
    dropdown: { operator: 'is', type: 'dropdown', label: 'Custom dropdown', choices: computed(function(){
      return [
          { id: 1, name: "Choice one"},
          { id: 2, name: "Choice two"},
          { id: 3, name: "Choice three"},
      ]
    }) },
  }
}),

#You can define statuses which can be fetched from server.

Statuses: computed(function(){
  return get(this, 'store').peekAll('people-status');
})

Configuration

Ember Filter is configured via the 'ember-filter' section in the application's config/environment.js file, e.g.:

ENV['ember-filter'] = {
  filterModelEndsWith: '-filter'
};

TODOs

  • Test cases
  • Pagination
  • Searchable filter elements
  • Show filter elements when there is value associated.
  • Support more options for form filters

ember-filter's People

Contributors

arunkumarvelu avatar pratheepv avatar venkateshg5887 avatar vikram-chaitanya avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.