- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2015 01:46 AM
Hi all,
I would like to create a custom table with pagination. I need to fill table with GlideRecord query.
I know that it is possible to use setLimit(int) function to get only requested number of rows, but it is somehow possible to set offset of this records, to be able to use pagination for fetching second, third... set of items ?
Example:
var gr = new GlideRecord('incident');
gr.skip(30); ----> how to do something like this ?
gr.setLimit(10);
gr.query();
1, 2, 3, 4, 5
---> will return fourth set of 10 records
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2015 04:21 AM
Hi Peter,
I think this is what you are looking for
gr.chooseWindow(10, 20); // this will give you 10 records, starting form the 11th to 20th.
Real more here in depth
GlideRecord Glimmerings: Windows...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2015 02:10 AM
Hi Peter
i don't think we have anything like these. For giving next record we use next() function on Glide Record object.. if you want it to start from fourth record.. i guess you need to call next() that many times.. that i will map that record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2015 02:33 AM
Hi Basha,
but I'm afraid that when I have 50 000 records (with paging 100) and want to display records from 40 000 to 40 100, if I do .next() 40 000 times, it will load all 40 000 records. I want to save some performance and load only requested 100 records. I'm looking for the best possible way, maybe you are right that I have no choice instead of use .next()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2015 02:40 AM
Yep.. your correct.. Lets c if any have better way to achieve that

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2015 02:41 AM
Hi Peter,
Clarify the below query.
As per you if 40,000 to 40,100 records are available how would you you need to send only 100 particular users..