Lesson 6: Add navigation to your application

This lesson describes code for moving forward and backward through the rows of the Customer table.

Add navigation code to your application
  1. Add the Next function to tutorial.js:

    function Next()
    {
        if( ! Table.moveNext() ) {
     Table.moveLast();
        }
    }
  2. Add the Prev function to tutorial.js:

    function Prev()
    {
        if( ! Table.movePrevious() ) {
     Table.moveFirst();
        }
    }
  3. Add the following functions to main.htm:

    function ClickNext()
    {
        Next();
        DisplayRow();
    }
    function ClickPrev()
    {
        Prev();
        DisplayRow();
    }
  4. When the form is first displayed, the controls are empty because 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.