This initializes a new instance of the page class. Where super keyword is used to access and call function in an object's parent.
xxxxxxxxxx
constructor(){
super();
}
The page constructor has four main arguments.
a. This is the page known as crud that references the same page as the main page.
xxxxxxxxxx
public mother:outlook.page,
b. The entity name associated with the records being administered.
xxxxxxxxxx
public subject: outlook.subject,
c. The table-head(th) operations permitted to be performed on the crud page.
xxxxxxxxxx
verbs?: Array<outlook.assets.verb>,
d. This argument represents the primary key and its position from where the administration was initiated. This
selection helps determine the offset/location of the displayed records. It contains :-
- the primary key.
- the original position that's used for updating the original table-data(td) using the obtained crud result.
xxxxxxxxxx
public selection?: theme.crud_selection
Mother is the super class, and calls a html page "crud" which is has to return a value as a null value is not allowed.
xxxxxxxxxx
super(mother, app.current.config!.crud);
For debugging purposes we'll use the identifier specified below .
xxxxxxxxxx
this.id='crud';
Carry out a save of the verbs if they are not empty else perform a save for all the possible cases
xxxxxxxxxx
this.verbs = verbs===(null || undefined)
? ["create", "review", "update", "delete"]
:verbs;
Save this as the current crud page for use in expressing event listeners on the crud page.
xxxxxxxxxx
page.current = this;
Finally set the theme panel to display when this page is administered. Also pass any crud selection from the caller if there are any.
xxxxxxxxxx
const Theme = new theme.theme(subject, "#content", this, this.selection)
this.panels.set("theme", Theme);
}