Giter Club home page Giter Club logo

layui-transfer's Introduction

Transfer 穿梭框组件-基于layui

版本冲突 >=layui2.5.4 版本更新 新版本

2018-11-23.17.37.27-GIF1.gif

在线体验 异步版本

如何使用:


<body>
<div id="root"></div>
</body>
<script>
layui.config({
  base: 'layui_exts/transfer/'
}).use(['transfer'],function () {
    var transfer = layui.transfer,$ = layui.$;
    //数据源
    var data1 = [{'id':'10001','name':'杜甫','sex':'男'},{'id':'10002','name':'李白','sex':'男'},{'id':'10003','name':'王勃','sex':'男'},{'id':'10004','name':'李清照','sex':'男'}];
    var data2 = [{'id':'10005','name':'白居易','sex':'男'}];
    //表格列
    var cols = [{type: 'checkbox', fixed: 'left'},{field: 'id', title: 'ID', width: 80, sort: true},{field: 'name', title: '用户名'},{field: 'sex', title: '性别'}]
    //表格配置文件
    var tabConfig = {'page':true,'limits':[10,50,100],'height':400}

    var tb1 = transfer.render({
        elem: "#root", //指定元素
        cols: cols, //表格列  支持layui数据表格所有配置
        data: [data1,data2], //[左表数据,右表数据[非必填]]
        tabConfig: tabConfig //表格配置项 支持layui数据表格所有配置
    })
    
    //transfer.get(参数1:初始化返回值,参数2:获取数据[all,left,right,l,r],参数:指定数据字段)
    $('.all').on('click',function () {
        var data = transfer.get(tb1,'all');
        layer.msg(JSON.stringify(data))
    });
    $('.left').on('click',function () {
        var data = transfer.get(tb1,'left','id');
        layer.msg(JSON.stringify(data))
    });
    $('.right').on('click',function () {
        var data = transfer.get(tb1,'r');
        layer.msg(JSON.stringify(data))
    });
})
</script>

问题反馈QQ群: 925487043

v1.2.1 2018年12月6日 11:46:42
修复未选中数据按钮能点击
v1.2 2018年12月4日 18:49:54
修复开启表格分页移动后数据消失BUG
v1.1 2018年11月29日 13:32:57
代码重构规范化

2018-12-15.02.34.10-ds.png

layui-transfer's People

Contributors

9499574 avatar

Watchers

 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.