My requests and My Open incidents Widgets should have pagination.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2018 04:33 AM
In the service portal home page , My requests and My Open incidents Widgets should have pagination instead row count beside that there should be a selection with choices 5,10,15,20,25,30,35,40,45,50. When the user selects 5 it should display 5 records in the widget. When 10 , should show 10 records. Same for the remaining. By default it should be 5 for the both My requests and My Open incidents Widgets.
How to achieve this?
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2018 01:12 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2018 02:47 PM
We wanted this too and decided just paging through at the options maximum entries size was the way to go. Here's the result:
Here's the approach we used:
HTML
<div class="panel-footer" ng-if="c.options.maximum_entries && c.data.count > c.options.maximum_entries">
<div class="h4 number-show-label panel-title" style="line-height: 20px">
${Showing items {{c.start + 1}} - {{c.end}} of {{c.data.count}}}
</div>
<nav id="prev-tab-nav" class="pull-right" aria-label="Previous requests and tasks page navigation">
<ul class="pagination">
<li>
<a href="#" aria-label="Previous" ng-disabled="c.currentPage == 1" ng-click="c.setCurrentPage(c.currentPage -1)">
<span aria-hidden="true">«</span>
</a>
</li>
<li>
<a href="#" aria-label="Next" id="prev-tab-next" ng-disabled="c.currentPage == c.numPages" ng-click="c.setCurrentPage(c.currentPage + 1)">
<span aria-hidden="true">»</span>
</a>
</li>
</ul>
</nav>
<div class="clearfix"></div>
</div>
CSS
#prev-tab-nav > ul {
margin:0;
}
CLIENT SCRIPT
this.currentPageItems = c.data.list.slice(0, c.options.maximum_entries)
this.currentPage = 1;
this.numPages = Math.ceil(c.data.list.length / c.options.maximum_entries);
this.start = 0;
this.end = this.start + c.options.maximum_entries < c.data.list.length ? this.start + c.options.maximum_entries : c.data.list.length - 1;
this.setCurrentPage = function(pageNum) {
if (pageNum < 1 || pageNum > this.numPages) return;
this.start = (pageNum - 1) * c.options.maximum_entries;
this.end = this.start + 5 < c.data.list.length - 1 ? this.start + c.options.maximum_entries : c.data.list.length;
this.currentPageItems = c.data.list.slice(this.start, this.end);
this.currentPage = pageNum;
};
I hope this helps you out.
Seth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2018 01:58 AM
This works great. Saved time. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2018 03:19 AM