View Code

Let’s learn how to implement the view code.

The user interface consists of a “Start” page, index.html, that allows us to navigate to data management UI pages, one for each object type. In our example, this includes books.html and publishers.html. Each of these data management UI pages contains five sections. There’s a “Manage” section with a menu for choosing a CRUD use case. There’s also a section for each CRUD use case, like “Retrieve” all books, “Create” book, “Update” book, and “Delete” book. Only one of them is displayed at any time if the CSS property display:none is set for all others.

Initialize the application

To initialize a data management use case, the required data, for instance, all publisher and book records, have to be loaded from persistent storage. This occurs with the help of a controller procedure such as pl.c.books.manage.initialize in c/books.js that uses the following code:

Get hands-on with 1200+ tech skills courses.