How to use multiple data-id in Oracle APEX?

I set data-id in ID column html expression, like: data-id=&ID. - and it works. But, how I can set data-id=&LAST_NAME. in same report and use that data-id in JavaScript?

2 Answers

Typically you add a class to the same html tag as the data attribute, for example class="myclass". Then add a dynamic action on click of jquery selector .myclass. In javascript then reference the value of the data-id with the expression this.triggeringElement.dataset['id'] - this could be used in an action of type "Set Value" to set a page item value to the data-id attribute of a clicked row.

Note that it doesn't have to be "data-id". It's possible to use "data-whateveryouwant". So you would have a "data-empno", a "data-ename" and a "data-deptno", all in the same html tag. Also explained here

4

When you use: example

 01. use the 02. add dynamic action on click of jquery selector .myClassName 03. set the page item value of multiple data attribute with js expression $(this.triggeringElement).data('id'); $(this.triggeringElement).data('last_name'); 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like