|
|
@ -630,14 +630,23 @@ $.fn.setPaging = function(config) {
|
|
|
|
config.next = function(index, label) {return '<li onclick="{func}" class="page-item next"><a class="page-link"><i class="tf-icon bx bx-chevron-right"></i></a></li>'.replace(/{func}/, config.func.replace(/{index}/, label));};
|
|
|
|
config.next = function(index, label) {return '<li onclick="{func}" class="page-item next"><a class="page-link"><i class="tf-icon bx bx-chevron-right"></i></a></li>'.replace(/{func}/, config.func.replace(/{index}/, label));};
|
|
|
|
config.last = function(index, label) {return '<li onclick="{func}" class="page-item last"><a class="page-link"><i class="tf-icon bx bx-chevrons-right"></i></a></li>'.replace(/{func}/, config.func.replace(/{index}/, label));};
|
|
|
|
config.last = function(index, label) {return '<li onclick="{func}" class="page-item last"><a class="page-link"><i class="tf-icon bx bx-chevrons-right"></i></a></li>'.replace(/{func}/, config.func.replace(/{index}/, label));};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let containers = config.containers || [];
|
|
|
|
|
|
|
|
if ("string" == typeof containers)
|
|
|
|
|
|
|
|
containers = containers.split(",");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let byID = "#" + config.prefix + "PagingInfo",
|
|
|
|
|
|
|
|
byName = "[name='" + config.prefix + "PagingInfo']"
|
|
|
|
|
|
|
|
selector = (containers.length < 1 ?
|
|
|
|
|
|
|
|
[byID, byName] :
|
|
|
|
|
|
|
|
containers.map(container => container + " " + byID + "," + container + " " + byName)
|
|
|
|
|
|
|
|
).join(",");
|
|
|
|
|
|
|
|
|
|
|
|
return this.each(function(){
|
|
|
|
return this.each(function(){
|
|
|
|
let length = config.list ? config.list.length : config.dataSize || config.dataLength,
|
|
|
|
let length = config.list ? config.list.length : config.dataSize || config.dataLength,
|
|
|
|
empty = length < 1,
|
|
|
|
empty = length < 1,
|
|
|
|
start = empty ? 0 : !config.added ? config.start + 1 : 1,
|
|
|
|
start = empty ? 0 : !config.added ? config.start + 1 : 1,
|
|
|
|
end = empty ? 0 : config.start + length,
|
|
|
|
end = empty ? 0 : config.start + length,
|
|
|
|
pagingInfo = empty ? "" : start + " ~ " + numberFormat.format(end) + " / " + numberFormat.format(config.totalSize),
|
|
|
|
pagingInfo = empty ? "" : start + " ~ " + numberFormat.format(end) + " / " + numberFormat.format(config.totalSize);
|
|
|
|
selector = "#"+ config.prefix + "PagingInfo,[name='" + config.prefix + "PagingInfo']";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(selector).html(pagingInfo);
|
|
|
|
$(selector).html(pagingInfo);
|
|
|
|
|
|
|
|
|
|
|
@ -653,14 +662,24 @@ $.fn.setPaging = function(config) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$.fn.setPagingInfo = function(config) {
|
|
|
|
$.fn.setPagingInfo = function(config) {
|
|
|
|
|
|
|
|
let containers = config.containers || [];
|
|
|
|
|
|
|
|
if ("string" == typeof containers)
|
|
|
|
|
|
|
|
containers = containers.split(",");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let byID = "#" + config.prefix + "PagingInfo",
|
|
|
|
|
|
|
|
byName = "[name='" + config.prefix + "PagingInfo']"
|
|
|
|
|
|
|
|
selector = (containers.length < 1 ?
|
|
|
|
|
|
|
|
[byID, byName] :
|
|
|
|
|
|
|
|
containers.map(container => container + " " + byID + "," + container + " " + byName)
|
|
|
|
|
|
|
|
).join(",");
|
|
|
|
|
|
|
|
|
|
|
|
return this.each(function(){
|
|
|
|
return this.each(function(){
|
|
|
|
let length = config.list ? config.list.length : config.dataLength,
|
|
|
|
let length = config.list ? config.list.length : config.dataLength,
|
|
|
|
empty = length < 1,
|
|
|
|
empty = length < 1,
|
|
|
|
pagingInfo = empty ? "" : 1
|
|
|
|
pagingInfo = empty ? "" : 1
|
|
|
|
+ " ~ "
|
|
|
|
+ " ~ "
|
|
|
|
+ numberFormat.format(length)
|
|
|
|
+ numberFormat.format(length)
|
|
|
|
+ " / " + numberFormat.format(config.totalSize),
|
|
|
|
+ " / " + numberFormat.format(config.totalSize);
|
|
|
|
selector = "#"+ config.prefix + "PagingInfo,[name='" + config.prefix + "PagingInfo']";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(selector).html(pagingInfo);
|
|
|
|
$(selector).html(pagingInfo);
|
|
|
|
});
|
|
|
|
});
|
|
|
|