gsr
05/08/2023, 1:56 AMpaul
05/08/2023, 2:00 AMgsr
05/08/2023, 2:08 AMpaul
05/08/2023, 2:11 AMgsr
05/08/2023, 2:13 AMgsr
05/08/2023, 2:13 AMpaul
05/08/2023, 2:14 AMgsr
05/08/2023, 2:16 AMgsr
05/08/2023, 2:16 AMpaul
05/08/2023, 2:16 AMgsr
05/08/2023, 2:18 AMpaul
05/08/2023, 2:19 AMgsr
05/08/2023, 2:20 AMgsr
05/08/2023, 2:21 AMMatt Jones
05/08/2023, 2:35 PMpublic string function limit( required struct inArgs ) {
local.limit = "";
local.maxLength = 100; // we don't want to exceed 100 (when using paging)
// for paging, must have a start and length. length = -1 is all records
if ( arguments.inArgs.KeyExists("start") && arguments.inArgs.KeyExists("length") && arguments.inArgs.length != -1 ) {
local.fetchSize = arguments.inArgs.length;
if ( !local.fetchSize || local.fetchSize gt local.maxLength ) {
local.fetchsize = 10;
}
local.limit = " offset #val( arguments.inArgs.start )# rows fetch next #val( local.fetchSize )# rows only ";
}
return local.limit;
}
old style is declared by dataTable():
we send back {sEcho:, iTotalRecords:, iTotalDisplayRecords:, aaData: }
iDisplayStart, iDisplayLength are what you will receive in your request from datatables to work with paging
iTotalRecords will hold your maxrownum
iTotalDisplayRecords will hold the count sent back for this page