Advanced Techniques - JavaScript in view tables

From Intrexx Version 19.03 onwards, $drRecord is no longer resolved in JavaScript calls within view tables. JavaScript calls in view tables, which use $drRecord, need to be modified accordingly. Access continues to functions as usual without any adjustments in free layout tables. This article shows you how to adjust your script when using Intrexx Version 19.03 or higher.



When a user clicks on "View ID" in this view table, a message appears with the record ID. So that this functions correctly in Intrexx Version 19.03 or higher, please proceed as follows:



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 is replaced by an access to the data record using
this.dataset.test
The call is defined as follows:
myFunction(this.dataset.test)
Here is the JavaScript for our example:
function myFunction(number){

	alert(number);
	return true;
}