Hello,
I have a RadButton on my page which has an OnClientClicking function tied to it. If I click the button with my mouse, this code is executed as expected. However, at some points in my page I need to programmatically call the click event. When I do this, the OnClientClicking is not being called. OnClientClicked is fired, but I was hoping that the clicking event would be as well. Is this the intended behavior of the RadButton, or is there something else other than 'click' that I need to call to get this event to fire? Or is there a way to cancel an event in the 'onclientclicked' function so I can just use that and not the clicking event? Below is a sample of what I'm talking about (not my exact code but hopefully should give you an idea of what is occuring).
Thanks!
Richard
// button definition
<telerik:RadButton onclientclicking='Clicking' runat='server' text='Test' id="myButton" />
// javascript
function Clicking(sender, args)
{
if (!confirm('Ok to continue this action?'))
args.set_cancel(true);
}
// this function programically causes a click
function ProgramClick()
{
var btn = $find('myButton');
btn.click(); // the Clicking event will not be fired.
}
I have a RadButton on my page which has an OnClientClicking function tied to it. If I click the button with my mouse, this code is executed as expected. However, at some points in my page I need to programmatically call the click event. When I do this, the OnClientClicking is not being called. OnClientClicked is fired, but I was hoping that the clicking event would be as well. Is this the intended behavior of the RadButton, or is there something else other than 'click' that I need to call to get this event to fire? Or is there a way to cancel an event in the 'onclientclicked' function so I can just use that and not the clicking event? Below is a sample of what I'm talking about (not my exact code but hopefully should give you an idea of what is occuring).
Thanks!
Richard
// button definition
<telerik:RadButton onclientclicking='Clicking' runat='server' text='Test' id="myButton" />
// javascript
function Clicking(sender, args)
{
if (!confirm('Ok to continue this action?'))
args.set_cancel(true);
}
// this function programically causes a click
function ProgramClick()
{
var btn = $find('myButton');
btn.click(); // the Clicking event will not be fired.
}