Tips & Tricks - JavaScript in view tables

In this view table, clicking on "Show ID" displays the data record ID in a notification.

Open the properties of the table column and define the Velocity part as the value of an expert attribute. Its name should begin with "data-" and be followed by lower-case letters only, for example. In our example, we enter the value

$drRecord.getRecId()

In the JavaScript call, the Velocity part with

this.dataset.test

is replaced by an access to the dataset. The call is defined as follows:

myFunction(this.dataset.test)

Here is the JavaScript for our example:

function myFunction(nummer){

	alert(nummer);
	return true;
}