Saturday, March 17, 2018

Paginated list of records in Angular Materials?

https://material.angular.io/components/table/overview might just be what we are looking for. A solution has been missing from the Angular space from a while, and only with Angular 5 and up do we get Angular Materials and the CDK. Of course, I have not used this yet myself as I am still working with Angular 4 professionally. Two jobs ago I worked on the challenge of just making my own thing instead. I was trying to remember what I did in attempting articulating it over text messaging today to a friend. Here is what I sent complete with bad grammar:

I just made something that expected a type I wrote. Off of the custom type, GridDetails, or whatever was a getsetter for an Array<any> which would be the collection for actual records. Maybe you could hand this in at the constructor. Anyways the GridDetails object would have other getsetter for number of pages in pagination and the grid had to be smart enough to compensate with a default if you left a setting off. To make a rightmost column full of buttons there would a Boolean for whether or not to show the column and a getsetter that expected a function that took a number and returned void. The number was for the index and the function itself could do a redirect or something.

No comments:

Post a Comment