Page:: review()

This method allows the user to filter and order records in a panel.

Parameters


This method has no arguments.

Description


This method is executed in a number of steps:

  1. To get the theme panel of this page then:

    const Theme = this.theme;

    a. Collect the filter and sorting inputs by

    • getting the condition entered by the user and convert it into a valid SQL statement.

      const condition = (<HTMLInputElement>this.get_element('filter')).value;

    • getting the sorting clause from the user.

      const clause = (<HTMLInputElement> this.get_element("sort")).value;

    b. Completing the where and sorting clauses using the below,

    const where = condition === ""?"":'where ${condition}';

    • Then get the entity's name.

      const ename = this.subject[0];

    • afterwards compile the complete clause where sorting by default is ascending with the primary keys otherwise the user overrides the default value.

     

    c. Use the original SQL statement to formulate a new working SQL in assumption that it has no where and ordering clause.

    • Update the current SQL adding the where and sorting clauses

    d. Repaint the theme panel with the following.

    • update the maximum records getting the number of records as a table of type (Ifuel).

    • set the maximum number of records.

    • clear the table body

    • reset the view

    • and finally go to the first record.