I have a page with alist or a grid that contains 2 buttons on each cell.
I am using a listener to find out when a user click on the cell, but what I need to have is to check which buttton on the cell was pressed...
I have a page with alist or a grid that contains 2 buttons on each cell.
I am using a listener to find out when a user click on the cell, but what I need to have is to check which buttton on the cell was pressed...
Hello Joni,
You can get the button, wich was clicked with JS below:
prevar button = event.target;/pre
I am getting a "ReferenceError: button is not defined"
Code:
element.on("click",function()
{
var button = event.target; // is not working
//here goes rest of code
}
);
It is better to use Appery.io visual builder to add events' handlers instead of custom listeners: https://devcenter.appery.io/documenta...
If you need to use that option - please add parameter event to your function:
preelement.on("click",function(event) {
var button = event.target; // is not working
//here goes rest of code
});/pre
Thanks Sergiy, I missed the event on function (event).
It worked. Fantastic job !