Git Product home page Git Product logo

filtermore's Introduction

filterMore-1.0

互联网风格前端筛选插件

目录

特性

  1. 首款开源筛选插件
  2. 参数配置项多,功能强大(演示
  3. 轻量级(8k)
  4. 支持所有流行的浏览器

快速上手

基本例子

页面使用一个占位Div

初始化

    var options = {
        //查询事件
        "search": function (paramList) {
            $("#basic_searchbox_param").html('查询参数:'+JSON.stringify(paramList));
        },
        //默认展开条件数
        "expandRow": 2,
        //查询条件
        "searchBoxs": [
            {
                "id": "Status_Basic",
                "title": "任务状态",
                "isMultiple":true,
                "data": [
                    { "value": "0", "text": "运行" },
                    { "value": "1", "text": "停止" }
                ]
            },
            {
                "id": "Createor_Basic",
                "title": "创建人",
                "data": [
                    { "value": "admin", "text": "系统管理员" },
                    { "value": "zhangsan", "text": "张三" }
                ]
            }
        ]
    };
    $("#basic_searchbox").fiterMore(options);

演示

默认值

初始化时可以设置默认选中项

    var options = {
               //查询事件
               "search": function (paramList) {
               },
               //查询条件
               "searchBoxs": [
                   {
                       "id": "Status_Default",
                       "title": "任务状态",
                       "isMultiple":true,
                     `  "defaults": ['0','1'], //默认选中值,没有则选中全部`
                       "data": [
                           { "value": "0", "text": "运行" },
                           { "value": "1", "text": "停止" }
                       ]
                   }
               ]
           };
           $("#defaultValue_searchbox").fiterMore(options);

演示

数据源格式自定义

可以自定义接收数据源格式

    var options = {
        //查询事件
        "search": function (paramList) {
        },
        //查询条件
        "searchBoxs": [
            {
                "id": "Task_CustomData",
                "title": "任务集合",
                "valueField":"taskId", //选项json 键字段名称 默认为value
                "textField":"taskName",   //选项json 值字段名称 默认为text
                "data": [
                    { "taskId": "1", "taskName": "代理ip爬虫任务" },
                    { "taskId": "2", "taskName": "日志清理任务" }
                ]
            }
        ]
    };
    $("#customData_searchbox").fiterMore(options);

演示

下载

方法

getParamList()

获取搜索条件参数

searchFunctionCall(options)

options:{"setValue":[]} key为要调用的函数名称 value:为函数调用参数

setValue函数为赋值函数 调用如下 $(".searchbox").searchFunctionCall(
{
    setValue:[
        {"ValueList":["1"],"id":"CreatedTime"}
    ]
})
getParamList函数为取值函数 调用如下 $(".searchbox").searchFunctionCall(
    {getParamList:null}
)

演示

更新日志

v1.0 release

1.发布版本:https://github.com/CrazyJson/filterMore

授权协议

Released under the MIT, BSD, and GPL Licenses

============

所有演示例子

filtermore's People

Contributors

crazyjson avatar

Watchers

James Cloos 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.