Simple List widget with pagination
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2018 03:57 AM
Hi guys,
How Can insert pagination on Simple List Widget ?
Thanks,
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2018 10:45 AM
Add the following Server-Script
data.window_size = data.window_size || $sp.getValue('maximum_entries') || 20;
data.page_index = data.p - 1;
data.show_new = data.show_new || options.show_new;
data.window_start = data.page_index * data.window_size;
data.window_end = (data.page_index + 1) * data.window_size;
gr.chooseWindow(data.window_start, data.window_end);
gr._query();
data.row_count = gr.getRowCount();
data.num_pages = Math.ceil(data.row_count / data.window_size);
data.column_labels = {};
data.fields_array = data.fields.split(',');
var grForLabels = new GlideRecord(data.table);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2018 11:34 PM
Good Day.
1) Create a UI Script
> API NAME : pagination.js
> Script : Copy the content of this URL
2) Create Widget Dependency
> Got to Service Portal > Dependencies
> New
> Name : pagination.js
> Check Incude on page load
> Angular Module Name : angularUtils.directives.dirPagination
> save
> In the JS inculdes related list
> Click New
> Display Name : pagination.js
> Source : UI Script
> UI Script : pagination.js
3) Import the XML file attached: https://docs.servicenow.com/bundle/jakarta-platform-administration/page/administer/development-best-...
4) Go to Service portal widgets > Simple list with pagination
5) Go to Dependenices related list
> edit
> Add pagination.js
While using this widget on any page, make sure "Maximum Entries" on widget options page is empty.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 10:23 AM
It was awesome.
Thanks Vinay Reddy for this wonderful work.
Regards,
Rajshekhar Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2018 06:55 AM
Thank you for explaining very nicely .can you please put little light step no 3.
3) Import the XML file attached: https://docs.servicenow.com/bundle/jakarta-platform-administration/page/administer/development-best-...
What to do in this step.What we need to export and import here please help me on that.
Thanks in advance.