diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/lib/grid/js/Grid.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/lib/grid/js/Grid.js index 9f5aa1739652b625cbf30b533a57ed9f1e730fd1..d2c2a4eb4868e49e1ef5dd9001b521efbc5cc809 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/lib/grid/js/Grid.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/lib/grid/js/Grid.js @@ -189,21 +189,17 @@ $.extend(Grid.prototype, { dataList = thisGrid.sortData(dataList, options.sortProperty, options.sortDirection); var result = {}; - var defaultPageSize = 50; - var startIndex = options.pageIndex * (options.pageSize || defaultPageSize); - var endIndex = startIndex + (options.pageSize || defaultPageSize); - endIndex = (endIndex <= result.count) ? endIndex : dataList.length; - result.count = dataList.length; result.datas = []; result.items = []; result.columns = thisGrid.getVisibleColumns(); result.page = options.pageIndex; - result.pages = Math.ceil(result.count / (options.pageSize || defaultPageSize)); - result.start = startIndex + 1; - result.end = endIndex; - - dataList = dataList.slice(startIndex, endIndex); + result.pages = Math.ceil(result.count / options.pageSize); + result.start = options.pageIndex * options.pageSize; + result.end = result.start + options.pageSize; + result.end = (result.end <= result.count) ? result.end : result.count; + + dataList = dataList.slice(result.start, result.end); itemList = thisGrid.renderData(dataList); itemList.forEach(function(item, index) { result.datas.push(dataList[index]);