Method declaration example
Level: intermediate
note
The functionality is relevant to Classic UI.
Example
Add the Email column validation logic to the logic of the setValidationConfig
method located in the Terrasoft.configuration.BaseSchemaViewModel
class.
- Protected method example
- New method example
methods: {
/* Method name. */
setValidationConfig: function() {
/* Call the setValidationConfig method of the parent schema. */
this.callParent(arguments);
/* Set up validation for the [Email] column. */
this.addColumnValidator("Email", EmailHelper.getEmailValidator);
}
}
methods: {
/* Method name. */
getBlankSlateHeaderCaption: function() {
/* Get the value of the MasterColumnInfo column. */
var masterColumnInfo = this.get("MasterColumnInfo");
/* Return the result value of the method. */
return masterColumnInfo ? masterColumnInfo.caption : "";
},
/* Method name. */
getBlankSlateIcon: function() {
/* Return the result value of the method. */
return this.Terrasoft.ImageUrlBuilder.getUrl(this.get("Resources.Images.BlankSlateIcon"));
}
}