【layui】下拉控件dropdown 简单的使用

官方网站地址: http://test.microanswer.cn/page/dropdown.html
1.代码
layui.use(['index', 'table', 'form', 'dropdown'], function () {
var $ = layui.$
, form = layui.form
, admin = layui.admin
, table = layui.table
, dropdown = layui.dropdown;
table.render({
elem: '#table-datalist'
, url: '/Console/ECUser/GetListJson'
, limit: 10
, title: ''
, where: {}
, cols: [[
{ type: 'checkbox', fixed: 'left' }
, { field: 'id', title: '编号', width: 60 }
, { field: 'countryCode', title: '区号', width: 60 }
, { field: 'phone', title: '手机号' }
, {
field: 'statusKey', title: '状态', width: 120, templet: function (res) {
if (res.statusKey == "allow_login")
return '<input type="checkbox" name="status" lay-skin="switch" lay-text="允许登录|禁止登录" lay-filter="table-state" value="' + res.id + '" checked="checked">'
else
return '<input type="checkbox" name="status" lay-skin="switch" lay-text="允许登录|禁止登录" lay-filter="table-state" value="' + res.id + '">'
}
}
, { fixed: 'right', width: 150, title: '详情信息', toolbar: '#table-datalist-detail' }
]]
, done: function (res) {
tableData1 = res;
dropdown.suite();
for (var i = 0; i < tableData1.data.length; i++) {
dropdown.onFilter("ft" + tableData1.data[i].id, function (event) {
var arr = event.split("-");
switch (arr[1]) {
case "user":
break;
case "assets":
break;
case "target":
break;
case "funding":
break;
}
});
}
}
, page: true
});
}
2.html
<script type="text/html" id="table-datalist-detail">
<button class="layui-btn layui-btn-xs" lay-filter="ft{{d.id}}" lay-dropdown="{align:'right',menus:[{layIcon:'layui-icon-username',txt:'用户详情',event:'{{d.id}}-user'},{layIcon:'layui-icon-form',txt:'资产列表',event:'{{d.id}}-assets'},{layIcon:'layui-icon-form',txt:'标的列表',event:'{{d.id}}-target'},{layIcon:'layui-icon-form',txt:'资金记录',event:'{{d.id}}-funding'}]}">
<span>操作</span>
<i class="layui-icon layui-icon-triangle-d"></i>
</button>
</script>
【layui】下拉控件dropdown 简单的使用的更多相关文章
- scrollview嵌套下拉控件嵌套recyclerview(不动第三方原基础自定义)
相信会碰到很多类似的需求,一个列表控件,然后控件上方的一个头部需要自定义,这样就不好有时候也不能加在列表控件的头部了,那必须得嵌套一层scrollview了,没毛病,那么一般的列表控件都是有上拉下拉的 ...
- DevExpress控件GridView挂下拉控件无法对上值
下拉控件使用RepositoryItemLookUpEdit,加入如下事件进行处理. repositoryItemLookUpEdit1.CustomDisplayText += new DevExp ...
- 一不小心写了个bootstrap风格下拉控件 JqueryUI + bootstrap
受够了EasyUI的封闭,Bootstrap虽然华丽但是功能太渣,闲着无聊写个下拉控件玩玩吧,不喜勿喷哈... 第一步:先设计下我的下拉控件的样子 1.既然是bootstrap风格的,我想应该是这样的 ...
- 基于bootstrap的multiple-select下拉控件使用
multiple-select是一款优秀的下拉菜单控件,能够支持单选和多选. 详细参考文档: JS组件系列——两种bootstrap multiselect组件大比拼 multiple-select ...
- 下拉控件jQuery插件
由于后端开发需要一个下拉控件,能输入,能选择,于是自己写了一个 ;(function($,window,document,undefined){ function Select(el,opt){ th ...
- 解决easyUI下拉控件无法触发onkeydown事件
实现在combotree下拉控件中按Backspace键清除combotree选中的值 下面的代码无法获取到键盘事件 <input class="easyui-combotree&qu ...
- 使用谷歌提供的SwipeRefreshLayout下拉控件,并自定义实现下拉加载的功能
package com.loaderman.swiperefreshdemo; import android.os.Bundle; import android.os.Handler; import ...
- SDI在自定义的工具栏上添加下拉控件
0.首先到自己的工具条上新建一个控件,并命名新ID 1.拷贝FlatComboBox.h和FlatComboBox.cpp到工程目录下 2.建立新类 class CTrackerToolBar : p ...
- java 下拉控件 转自 http://www.cnblogs.com/lhb25/p/form-enhanced-with-javascript-three.html
表单元素让人爱恨交加.作为网页最重要的组成部分,表单几乎无处不在,从简单的邮件订阅.登陆注册到复杂的需要多页填写的信息提交功能,表单都让开发者花费了大量的时间和精力去处理,以期实现好用又漂亮的表单功能 ...
- 下拉框、下拉控件之Select2。自动补全的使用
参考链接: 参考一:https://blog.csdn.net/weixin_36146275/article/details/79336158 参考二:https://www.cnblogs.com ...
随机推荐
- JSP第四次作业
1. 1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8&q ...
- Vue35 路由
1 简介 vue-router是vue的一个插件,专门用来实现SPA应用.SPA也就是单页Web应用,特点是:整个应用只有一个完整的页面,点击页面中的导航链接不会刷新页面,只会做页面的局部更新,数据需 ...
- ElasticSearch使用教程
一.ElasticSearch使用说明 1. 索引 index,相当于数据库表Table 1.1 查看所有索引 GET _cat/indices?v 1.2 创建索引字段映射关系 PUT /test ...
- .net core 阿里云接口之拷贝文件
紧接上文, 1).net core 阿里云接口之获取临时访问凭证_SunshineGGB的博客-CSDN博客 2).net core 阿里云接口之将指定的OSS文件下载到流_SunshineGGB的博 ...
- .net core 删除指定路径下的所有文件以及文件夹(文件夹建议保留目录)
1.服务层 /// <summary> /// 删除指定路径下的所有文件 /// </summary> /// <param name="filepath&qu ...
- Networking && Internet 计网学习笔记一
Networking && Internet 计网学习笔记一 参考书籍: James F. Kurose, Keith W. Ross. 计算机网络-自顶向下方法 (7th). 机械工 ...
- Istio 升级后踩的坑
背景 前段时间我们将 istio 版本升级到 1.12 后导致现有的应用监控有部分数据丢失(页面上显示不出来). 一个是应用基础信息丢失. 再一个是应用 JVM 数据丢失. 接口维度的监控数据丢失. ...
- 郁金香逆向 2.便利怪物对象数组 纯C写法
读取基础地址 获取节点数量 打印怪物列表 进行遍历 环环相扣
- Hyperledger Fabric部署与测试(Ubuntu)
Fabric部署与测试 Fabric部署与测试最正确的还是参照官方链接:Hyperledger Fabric官方链接 ok,接下来开始部署Fabric.(以Ubuntu为例) 一.部署Fabric 1 ...
- NOIP 模拟赛 左右横跳
\(\text{Problem}\) 大意就是优化这样一个 \(dp\) \[f_{i}=\max f[j]+(i-j) \cdot (i-j-1) \] \(L[i] \le j < i,n\ ...