lrselect组件
Intro
lrselect是一个模拟多选框,可自定义样式,包括选择,移除,全部选择,全部移除,撤销,取消撤销,重新渲染等功能键,支持shift+点击 连续选,control(command)+点击多选。
Author
name:kerry
email:[email protected]
Example
http://codepen.io/qiuyaofan/pen/GqmkEb
Options
@param {level} 渲染级别 默认为'1'
@param {dataJson} 渲染的json 默认为空,不同级别对应的json格式不同
@param {afterMoveLeft} 左移/移除回调 回调函数
@param {afterMoveRight} 右移/选择回调 回调函数
Methods
moveRight:右移/选择方法(参数:目标元素)
moveLeft:左移/移除方法(参数:目标元素)
moveRightAll:全部右移/选择方法(参数:无)
moveLeftAll:全部左移/选择方法(参数:无)
updateJson:重新渲染方法(参数:json, level)
Usage
//全局引用
var objectExamples=$('.lrselect-main').IUI('lrselect',{
level:2,
dataJson:json,
afterMoveLeft:function(val){
// console.info('移到左边');
// console.info($('.lrselect-main').find('select').val());
},
afterMoveRight:function(val){
// console.info($('.lrselect-main').find('select').val())
// console.info('移到右边');
}
});
Attention
注意所需的json格式