I have an aspx page PopupReference. I am having Tridion control button and few asp controls too, like asp:ddSelectOption (Dropdown).
So in Popupreference.js as we are creating event handler for Tridion button I am trying to create the same for my asp controls as below:
This is Tridion button:
c.InsertButton = $controls.getControl($("#InsertButton"),
"Tridion.Controls.Button");
This is my dropdown:
c.ddSelectOption = $("#ddSelectOption");
Event handler for tridion button:
$evt.addEventHandler(c.InsertButton, "click", this.getDelegate(this._execute));
Event handler for my dropdown:
$evt.addEventHandler(c.ddSelectOption, "onselectedindexchanged",
this.getDelegate(this._ondropdownitemchanged));
console.log('eventhandler created');
I am calling the function :
RTFExtensions.Popups.PopupReference.prototype._ondropdownitemchanged =
function PopupReference$_ondropdownitemchanged(event) {
Console.log('Initializing inside dropdown...');
};
But I am not able to see the last log anywhere, I think its not getting inside the function ondropdownitemchanged(event). Does anyone have any clue how I can make this happen?
I suspect your
onselectedindexchangedevent needs to be achange?I’ve implemented something similar using a drop down, here are the pieces from my code. I hope this helps you to find your solution:
1) In the html / aspx page:
2) In your JavaScript:
Adding the event handler:
The method:
I’d tackle it in the following ways:
Good luck