Tips & Tricks - JavaScript in view table

In a view table, clicking on a button displays the data record ID in a message. This article shows how such a message can be displayed using JavaScript.

Enter the velocity part in the properties of the table column as the value of an expert attribute whose name begins with "data-" and contains only lowercase letters, such as the expert attribute "data-test" with 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 formulated as follows:

            myFunction(this.dataset.test)
        

Here is the JavaScript for our example:

            function myFunction(nummer){

	alert(nummer);
	return true;
}