This lesson describes code for scrolling forward and backward through the rows of a result set.
Add the MoveNext function to tutorial.js, immediately after the Insert function:
function MoveNext() { if( ! CustomerTable.moveNext() ) { CustomerTable.moveLast(); } }
Add the MovePrev function to tutorial.js, immediately after the MoveNext function:
function MovePrev() { if( ! CustomerTable.movePrevious() ) { CustomerTable.moveFirst(); } }
Add the following procedures to main.html:
function ClickNext() { MoveNext(); DisplayCurrentRow(); } function ClickPrev() { MovePrev(); DisplayCurrentRow(); }
Synchronize your application and test the navigation buttons.
When the form is first displayed, the controls are empty as the current position is before the first row. After the form is displayed, click Next and Previous to move through the rows of the table.