Is your feature request related to a problem? Please describe.
The current standalone pager only supports indeterminate mode.
Describe the solution you'd like
Add the ability to set the 'indeterminate' to false, and to provide the total item count, allowing the pager to select individual pages.
This would also require a new Output event - onPageSelect.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
@tmcconechy - does the EP version support this, is it just a matter of exposing some additional functionality?
Im not sure if this makes 100% sense. Because the idea behind the standalone pager is you just control the states of the pager yourself and use the events to know when someone clicked a pager control so you should be able to do whatever you want based on that (fetch what you want on the events and update the pager control states how you want it to work).
cc @pwpatton as i think thats what he did
The angular component does not allow the total page count and/or total row count to the specified, so does not allow the current page to be shown or entered.
Ah ok sorry, your right. I only built it out with what was there in the indeterminate pager as that was all that was needed at the time by the requester (Phillip). So yes, would need to add settings to show Page 1 of 100 and the input (possibly two settings?) So no those two aren't there on standalone pager yet.
Correct, the stand-alone pager for now only has things relevant to the indeterminate setting: first, last, next, prev and pagesize.
Also when I click on a disabled pager control button it causes a page refresh, looks like an default anchor is being fired. (Will raise a different issue for this, but thought I'd mention it.)
But it could be updated to allow for more than indeterminate. IMO it's better to have pager as a "slave" component that does nothing more than responding to inputs and fire events for output.
@pwpatton I can add the missing functionality - just need a means to detect the page selection:
@Output() pageSelected = new EventEmitter<PageSelectedPagerEvent>();
@Input() set totalRows(totalRows: number) {
this.options.totalRows = totalRows;
this.updated == !!this.pager; <--- gotta love this line!!!!
}
onPageSelected(page: PageSelectedPagerEvent) {
this.pageSelected.emit({page})
}
should have been this.updated = !!this.pager;
@tmcconechy doesn't adding the page and totolRecs require the matching things in EP? I had thought you had built the standalone-pager.js for just the indeterminate parts.
@bthharper if the EP parts work then yea, that would be awesome. Just need to listen to a change event I supposed for the page selection change and then have your data retrieval act accordingly.
That was my opening question to @tmcconechy ;-)
Yes, sorry i read it wrong. Your right we should extend to add page input and page count (controlled dummily). So I think that means "inputs" to set the page count , if page count shows, current page, if current page input shows. And maybe the page counter 1 2 3 4 5 style pager vs input style pager.
@tmcconechy also want the page chooser to be "responsive". can we add that in for standalone pager? I know ed had already done style work of making a "mini" page size chooser. But would like it to display it "mini" when the pager narrows. I should probably make a separate ticket for that eh?
OK, yeah looks like you can only show or hide it doesnt automatically switch. I think that would be a lot more work since its css driven.
I'll make an ep ticket for that and we can get it on the schedule
perhaps if it changes on the fly via the setting we could just do it our selves.
Yeah i think this whole ticket can go over there, if you we want to just list all the additions and can maybe keep this one for the NG part or close?
I would leave this one here to make the corresponding changes to NG, but mark it as pending the corresponding EP changes.
I assumed it would look exactly like the standard pager you would get on a datagrid when not in indeterminate mode.
Closing this for now - but working this into the web component version. The pager will be just a dumb component with events.
Most helpful comment
That was my opening question to @tmcconechy ;-)