How is your experience with the OutSystems Community?
0
Views
2
Comments
addEventListener on Interaction\Calendar navigation button
Question

Hi,

I want to add functionality of Interaction\Calendar buttons by this way: 

1. Create an OnRender client action including a javascript functions

2. The javascripts:

/*********************************************************/

document.querySelector("button.pika-prev").style.color = "yellow";
document.querySelector("button.pika-prev").addEventListener("click", x);
function x(){
    alert("test");
}

/*********************************************************/

3. when run the screen, the prev button is successfully set to "yellow", but the "click" event fail to be attached to the button.


Am I missing something?



Regards,

Eddy








UserImage.jpg
Eddy Krismanto

This is a mobile project

Thanks..

2016-04-21 20-09-55
J.
 
MVP

Hi,


First of all i am not sure the selector is right, but that is not the most important one.

Afaik alert is not the best way to test functions. They can be supressed by the browser.

Better use consol.log or actually changing something in the dom..


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.