Knockout-Contrib / Knockout-Contrib/KoGrid
Pagination issue in examples
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 277
- Forks
- 124
- PR merge metrics
- No merged PRs in 30d
Description
I have found on issue with largeData example,
It looks like pagination in this case dos't work correct code in main.js:
self.getPagedDataAsync = function (pageSize, page, searchText) {
setTimeout(function () {
var data;
if (searchText) {
var ft = searchText.toLowerCase();
data = largeLoad().filter(function (item) {
return JSON.stringify(item).toLowerCase().indexOf(ft) != -1;
});
} else {
data = largeLoad();
}
//var pagedData = data.slice((page - 1) * pageSize, page * pageSize);
self.myData(data);
self.pagingOptions.totalServerItems(data.length);
}, 100);
};
show all data in grid not first. How to use pagination in correct way ?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the largeData example's main.js at getPagedDataAsync, then compare the current data assignment with the commented slice expression. Run the example with a page size and confirm that the grid shows only the requested page while totalServerItems still reflects the full filtered data set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100