layui 第三方組件平臺

返回首頁 發(fā)布組件

雙欄穿梭選擇框。 用直觀的方式在兩欄中移動元素,完成選擇行為。 選擇一個或以上的選項后,點擊對應的方向鍵,可以把選中的選項移動到另一欄。

更新:2019-7-30 創(chuàng)建:2018-11-29

文檔



<body>
<div id="transferTable"></div>
</body>
<script type="text/javascript">
layui.config({
base:'js/layui_exts/'
}).use('transferTable', function(){
var transferTable = layui.transferTable,$=layui.$;
var cols = [
{checkbox: true, fixed: true}
,{field:'id', title: 'ID'}
,{field:'username', title: '用戶名'}
,{field:'sex', title: '性別'}
]

transferTable.render({
elem: '#transferTable'
,url: ['api.php?t=1','api.php?t=2']
,cols: [[cols],[cols]]
,page: [true,true]
,id:['transferTable_1_1','transferTable_2_2']
,height:[500,500]
,where:{id:'1,2,3'}
,id_name:'id'
})

$('#reload').on('click',function(){
transferTable.reload('transferTable_1_1',{
page:{curr:1},
where:{
title: $('#title').val(),
sex: $('#sex').val()
}
})
})

$('#submit').on('click',function(){
var id = transferTable.get('transferTable_2_2');
layer.msg(JSON.stringify(id));
})

})
</script>

下載

立即下載 去 GitHub 下載
該擴展組件由第三方用戶主動投遞,并由其自身進行維護,本站僅做收集。