Consider the following situation:
HTML
<a id="mButton" data-role="button" data-click="clickFn">myButton</a>
<asp:ImageButton runat="server" ID="aspButton" style="display: none"></asp:ImageButton>
SCRIPT
function clickFn(e) {
$("#aspButton").click();
}
After clicking on "mButton", the click event of "aspButton" is rarely activated. I have attempted to bind to the "mButton" touchend event without success.
Is there a way to utilize an anchor tag with the data-role="button" attribute to trigger the click event of an asp button? My environment includes the latest Kendo UI Mobile and jQuery versions.
Thank you!
Update
By modifying my clickFn function to the following, it now works flawlessly:
function clickFn(e) {
setTimeout(function () {
$("#aspButton").click();
}, 400);
}
This discovery suggests that Kendo UI Mobile's event handling might be causing this issue. It seems that the View transition speed in Kendo UI Mobile is set to 400ms, hence the need for the 400ms delay before executing the aspButton click event successfully.
I hope this information proves helpful.