Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.0 (中文) » UltraLite - M-Business Anywhere 编程 » 教程:M-Business Anywhere 示例应用程序

 

第 6 课:将导航添加到应用程序

本课介绍用于在 Customer 表的各行之间前移和后移的代码。

 ♦  将导航代码添加到应用程序
  1. Next 函数添加到 tutorial.js

    function Next()
    {
        if( ! CustomerTable.moveNext() ) {
     CustomerTable.moveLast();
        }
    }
  2. Prev 函数添加到 tutorial.js

    function Prev()
    {
        if( ! CustomerTable.movePrevious() ) {
     CustomerTable.moveFirst();
        }
    }
  3. 将以下函数添加到 main.htm

    function ClickNext()
    {
        Next();
        DisplayRow();
    }
    function ClickPrev()
    {
        Prev();
        DisplayRow();
    }
  4. 当窗体第一次显示时,由于当前位置是在第一行的前面,所以控件是空的。在窗体显示后,单击 [Next] 和 [Previous] 按钮可在表中的行之间移动。