Hi,I'm writing some common javascript code for navigating away from the page.i wrote the code on window.onbeforeclose() event this code is executed when i click on the webdropdown buttonto open the list of items while it should not call this event.to come over this problem I tryied to set some class on the controls where i dont wnat this event to firebut the jQuery addClass does not work with infragistic controls and hasClass always returns nullwhat can i do to identify the controls in jQuery and code accordinglly whatever solution u suggest should be applicable to all the controls with set and get as i want to set some property and then check it again on Onbeforeclose() event and if the property is set i wount fire that code. The best solution will be if the dropdown not fire the OnBeforeClose event.
Hey,
Could you clarify a bit your scenario and what exactly you are trying to achieve ? Are you creating a workaround because some functionality does not work as you expect? The WebDropDown doesn't have an OnBeforeClose event, it only has the following events related to opening and closing - DropDownOpening and DropDownOpened / DropDownClosing, DropDownClosed.
If you want to apply a special class to the control itself, you can do that easily with jQuery in the following way:
$("#DropDownElementID").addClass('someNewClass');
if you want to apply a class to the dropdown container itself, you can do that
var dropdownObject = $find("theID");
$(dropDownObject._elements["DropDown"]).addClass(myClass);
Hope it helps. If you can answer the above for me, or show me some code snippet, i will be able to provide you with more help.
Thank you,
Angel
HI Angel,Actually I want to implement the go away message if user tries to close the window without Saving the Data. as this requirement is applied to all the pages in my app i'm trying to use some common code for it .I 'm trying to handle the Window.OnBeforeUnload event in the javascript this method will compare the current values of the controls by initialvalues and if there is any change it will give the message.my problem is that when i open the webdropdown list and select some item from it the webdropdown fires the window.onbeforeclose event that i dont want to fire at that time.
Hi Angel,
I have the same problem too. I am using "window.onbeforeunload" but when i check or uncheck any item in the webdropdown the javascript function is invoked and i want to avoid this behavior.