GithubHelp home page GithubHelp logo

dynamicfilter's Introduction

dynamicfilter

a angular directive that can dynamic add/remove filter conditions


  • define some modles that participate in construct a search query
  • include fieldid, fieldname, fieldtype, operator and datasource
  • different fieldtype can have different input element, e.g. enum type have a select element
  • some element can have remote datasource
  • every condition has 3 properities which stored in 3 hidden elements, backend request the form data to group these properities, then compose them as query to database

How to Use

set query models

//your query models
$scope.fall = [
    {
        fieldname:'enum field with obj array',
        field:'fdenum2',
        fieldtype:fieldType.enum,
        enumtype:'obj',
        enumkey:'key',
        enumval:'val',
        datasource:[{key:'key1',val:'val1'},{key:'key2',val:'val2'},{key:'key3',val:'val3'}] // or remote url
    }
]
//chosed query models
$scope.fuse = []

gen a button

<zkxfiltericon data="fall" out="fuse"></zkxfiltericon>

gen result fields

<zkxfilterbox data="fall" out="fuse"></zkxfilterbox>

run a web server

because the demo use absolutely url /root/to/file, so deploy a web server to run.


###License © 2014 GPL license

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.