4 Star 42 Fork 9

helpproject / layui-formTable

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

layui-formTable

介绍


form input搜索以表格提示内容

说明

版本要求layui2.7+

代码示例


<input type="text" name="parts" autocomplete="off" class="layui-input">

layui.config({
  base: '/plugin/layui/common/', //拓展模块的根目录
})
  .extend({
    formTable: '/formTable/formTable'
  });
layui.use(['table', 'form', 'formTable'], function () {
  const formTable= layui.formTable;
  // 查询自动提示
  const searchTable = formTable.render({
    elem: 'input[name=parts]',
    url: "/getPart",
    searchKey: 'car_number', // 设置搜索
    searchKeyMinLength: 4, // 设置搜索最少字符长度
    width: 730, page: true, limit: 15,   // 分页
    table: {
      cols: [[
        { type: 'numbers', title: '编码', width: '3%' },
        { field: 'part_brand', title: '品牌', width: '10%' },
      ]],
      height: 180,
      tool: {
        'add': (data) => {
          // 表格tool触发事件
        },
      },
      rowDouble: (data) => {
        //触发行双击事件
      }
    },
  })

  // 关闭弹框
  searchTable.hide()
  // 重置实例
  searchTable.reload()
})

展示案例

这是图片

layui扩展功能

一个基于layui的自定义表单

这是图片

一个综合表单条件过滤器

这是图片

MIT License Copyright (c) 2021 helpproject Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

form input搜索以表格提示内容 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/Mr.zhaoGW/layui-form-table.git
git@gitee.com:Mr.zhaoGW/layui-form-table.git
Mr.zhaoGW
layui-form-table
layui-formTable
master

搜索帮助