2.1.0
This commit is contained in:
parent
f4a79c8431
commit
02a70bd789
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "layui",
|
"name": "layui",
|
||||||
"main": "src/layui.js",
|
"main": "src/layui.js",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"homepage": "https://github.com/sentsin/layui",
|
"homepage": "https://github.com/sentsin/layui",
|
||||||
"authors": [
|
"authors": [
|
||||||
"sentsin <xu@sentsin.com>"
|
"sentsin <xu@sentsin.com>"
|
||||||
|
2
dist/lay/modules/table.js
vendored
2
dist/lay/modules/table.js
vendored
File diff suppressed because one or more lines are too long
2
dist/layui.all.js
vendored
2
dist/layui.all.js
vendored
File diff suppressed because one or more lines are too long
@ -436,7 +436,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//数据排序
|
//数据排序
|
||||||
Class.prototype.sort = function(th, type, pull){
|
Class.prototype.sort = function(th, type, pull, formEvent){
|
||||||
var that = this
|
var that = this
|
||||||
,field
|
,field
|
||||||
,config = that.config
|
,config = that.config
|
||||||
@ -494,10 +494,12 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
|
|||||||
}, that.page, that.count, true);
|
}, that.page, that.count, true);
|
||||||
layer.close(that.tipsIndex);
|
layer.close(that.tipsIndex);
|
||||||
|
|
||||||
layui.event.call(th, MOD_NAME, 'sort('+ filter +')', {
|
if(formEvent){
|
||||||
field: field
|
layui.event.call(th, MOD_NAME, 'sort('+ filter +')', {
|
||||||
,type: type
|
field: field
|
||||||
});
|
,type: type
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//请求loading
|
//请求loading
|
||||||
@ -687,16 +689,16 @@ layui.define(['laytpl', 'laypage', 'layer', 'form'], function(exports){
|
|||||||
} else {
|
} else {
|
||||||
type = 'asc';
|
type = 'asc';
|
||||||
}
|
}
|
||||||
that.sort(othis, type);
|
that.sort(othis, type, null, true);
|
||||||
}).find(ELEM_SORT+' .layui-edge ').on('click', function(e){
|
}).find(ELEM_SORT+' .layui-edge ').on('click', function(e){
|
||||||
var othis = $(this)
|
var othis = $(this)
|
||||||
,index = othis.index()
|
,index = othis.index()
|
||||||
,field = othis.parents('th').eq(0).data('field')
|
,field = othis.parents('th').eq(0).data('field')
|
||||||
layui.stope(e);
|
layui.stope(e);
|
||||||
if(index === 0){
|
if(index === 0){
|
||||||
that.sort(field, 'asc');
|
that.sort(field, 'asc', null, true);
|
||||||
} else {
|
} else {
|
||||||
that.sort(field, 'desc');
|
that.sort(field, 'desc', null, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -298,6 +298,11 @@ layui.use('table', function(){
|
|||||||
//监听排序
|
//监听排序
|
||||||
table.on('sort(test)', function(obj){
|
table.on('sort(test)', function(obj){
|
||||||
console.log(this, obj)
|
console.log(this, obj)
|
||||||
|
|
||||||
|
return;
|
||||||
|
table.reload('test', {
|
||||||
|
height: 300
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user