HI guys,
Sometimes I would find it useful if there was a way to navigate directly to the first or last page. So you could add two additional icons, like this:
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Navigate to First & Last Record
Navigate to First & Last Record
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4416
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 472 times
- Contact:
Re: Navigate to First & Last Record
Timo,
This code will add two additional icons - go to first and last record - to the navigator.
Add it under Setup -> Header
This code will add two additional icons - go to first and last record - to the navigator.
Add it under Setup -> Header
Code: Select all
function nuOnLoad()
{
if (nuFormType() == 'browse')
{
var b = '<span id="nuFirst" class="nuBrowsePage"><i class="fa fa-step-backward" onclick="nuGetPage(0)"> </i></span>';
$(b).insertBefore("#nuLast");
var lastPage = $('#nuBrowseFooter').text().match(/[0-9]+/g);
b = '<span id="nuLast" class="nuBrowsePage"> <i class="fa fa-step-forward" onclick="nuGetPage(' + lastPage + ')"></i></span>';
$(b).insertAfter("#nuNext");
}
}
You do not have the required permissions to view the files attached to this post.
Re: Navigate to First & Last Record
Hi.
I found a bug. Perhaps there has been a change in the code since 2019.
Old: nuGetPage(0)
New: nuGetPage(1)
I found a bug. Perhaps there has been a change in the code since 2019.
Old: nuGetPage(0)
New: nuGetPage(1)
Code: Select all
function nuOnLoad()
{
if (nuFormType() == 'browse')
{
var b = '<span id="nuFirst" class="nuBrowsePage"><i class="fa fa-step-backward" onclick="nuGetPage(1)"> </i></span>';
$(b).insertBefore("#nuLast");
var lastPage = $('#nuBrowseFooter').text().match(/[0-9]+/g);
b = '<span id="nuLast" class="nuBrowsePage"> <i class="fa fa-step-forward" onclick="nuGetPage(' + lastPage + ')"></i></span>';
$(b).insertAfter("#nuNext");
}
}
-
- nuBuilder Team
- Posts: 4416
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 472 times
- Contact:
Re: Navigate to First & Last Record
Hi,
This function is already incorporated into nuBuilder, and the issue was already fixed some time ago.
This function is already incorporated into nuBuilder, and the issue was already fixed some time ago.
Code: Select all
nuAddBrowseAdditionalNavButtons();