I wanted to know if the following was possible.
I've created a classic report querying some irrelevant data. Lets assume it's the following product table:Product_idProduct_name
1 Bread 2 Milk 3 Eggs 4 Apples 5 Bottled Water
On the product_name column I've added a class: .productName
I created a dynamic action with:
selection type: jQuery Selector
jQuery Selector: .productName
as shown below
var txt =$(this).text();
I expected if I clicked on milk then 'Milk' would pop up in an alert box, and if I clicked on eggs then 'Eggs' would pop up and so on.
However a blank alert box pops up.
Is it not possible to use $(this) inside the dynamic action true event?
Yes it is, but it doesn't make sense to do so because in this context
thisis a dynamic action object, not a DOM element. The clicked element can be accessed using the DA object's
triggeringElementproperty. What you should be using in your code is