代码拉取完成,页面将自动刷新
互联网风格前端筛选插件
页面使用一个占位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);
获取搜索条件参数
options:{"setValue":[]} key为要调用的函数名称 value:为函数调用参数
setValue函数为赋值函数 调用如下 $(".searchbox").searchFunctionCall(
{
setValue:[
{"ValueList":["1"],"id":"CreatedTime"}
]
})
getParamList函数为取值函数 调用如下 $(".searchbox").searchFunctionCall(
{getParamList:null}
)
1.发布版本:https://github.com/CrazyJson/filterMore
Released under the MIT, BSD, and GPL Licenses
============
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。