jonatanklosko / md-collection-pagination Goto Github PK
View Code? Open in Web Editor NEWAngular Material Design component for paginating a collection.
Home Page: https://www.npmjs.com/package/md-collection-pagination
License: MIT License
Angular Material Design component for paginating a collection.
Home Page: https://www.npmjs.com/package/md-collection-pagination
License: MIT License
LICENSE file should be added to repository and also mention used license in README.md
I've got a pagination problem after I've selected a new itemsPerPage value on a dropdown. After the second page, all my items in collection were being shown.
That problem occurs in the update function (line 190-194). When the code slices the array for the new paginatedCollection, the code was concatenating the offset with the new perPage value (since it was binded to an ng-model).
To solve it, I've just added a parseInt() to the this.perPage variable.
line 193:
this.paginatedCollection = this.collection.slice(offset, offset + parseInt(this.perPage));
That solved for me. If this is the best solution and you want to commit to the code that would be nice!
And thanks a lot for your directive. I was looking for one just like this one!!
I used a filter function within the ng-repeat and the visible list didn't update after the filter. Let's say that I had a list of 15 objects and I filtered one that was on the last page. All the objects were gone and the pagination gave me 2 pages of empty list and the last page with the single object.
Sorry that this time I cannot suggest a correction but it is too much reverse engineer lol.
Here is the simplified version of the code that I've used:
<md-list-item ng-repeat="object in tc.uiObjectList | filter:tc.objectsFilter">
<md-collection-pagination collection="tc.objectList" paginated-collection="tc.uiObjectList" per-page="tc.entitiesPerPage"></md-collection-pagination>
vm.objectsFilter = function(item) {
if (item.shortName.search(new RegExp(vm.entitySearch, "i")) >= 0) {
return true;
}
return false;
};
am using this collection-pagination in my code...its shows an error like this..
Cannot read property 'length' of undefined
can you solve this issue...
We are seeing an issue where our data is loaded after the page is loaded, and vm.items is not updating. Can we alter/add more data to "vm.users" after the page has loaded? (need to make API calls to actually GET the data before displaying it).
Our data looks like this (not simply an array of Strings), its an Array of Objects.
$scope.playlists = [
{name:"asdf", id:"19ahd",},
{name:'asdf2', id:'123'},
];
I have a long list and I let the backend to handle the pagination. I need to manually specify the "total number of items" but it is automatically derived from collection's length. I dont know if this is on this project's specs but it might be a good feature to add.
Seems like this main repo has only npm
install and not eg, bower
.
Is there some reason for lacking bower package?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.