This is a migrated thread and some comments may be shown as answers.

Kendo mobile with backbone, button click not working on iphone/ipad

3 Answers 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 08 Mar 2013, 12:54 PM
I am using Kendo Mobile with Backbone. While the events described within Backbone views works perfectly in Desktop browsers, they do not work in iPhone/iPad.

var Home = Backbone.View.extend({
  events : {
    'click #new_idea' : 'addNewIdea'
  },
  .....
});
However, if I attach these events directly to the Kendo component, they seem to work fine in both desktop and mobile browsers. Like this:

$('#login_button').kendoMobileButton({
  click : this.doLogin
});
Now, the first idea is anyway preferable to me as an application point of view. Can you please tell me what exactly happening here? Do I anyway need to use "tap" event here?

3 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 11 Mar 2013, 03:22 PM
Hello Dave,

There is a difference between the DOM click event (to which Backbone binds to) and the button widget click event which is optimized to use different DOM events based on the browser/platform. 

The solution to that problem would require some custom scripting, which discovers a widget instance when binding to a given selector, and binds to its event instead of the DOM one. If you are interested in such solution, you may consider contributing to this community based github project.

Kind regards,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dave
Top achievements
Rank 1
answered on 12 Mar 2013, 07:43 AM
Hi Petyo,

Thank your for your reply. It seems that this issue is specific to Kendo Mobile. Because no one mentioned the issue while integrating Kendo UI with BackBone. Even I followed Derick's discussion here which didn't mention anything about it. 

The difference you mentioned, if that is the case, then I think anyway I have to find out the Kendo instance of the component and then add an event on it. Which, in other way, means to apply the events directly on Kendo widgets. So, do you want to say backbone events will not work here or it will not work only on the Kendo widgets?

Also, it is noticed that the events work absolutely fine in desktop browsers but do not on device browsers. So, while I tap a button, I can see the transition of pressed button but that doesn't initiate the "click" event. Does it require to write an explicit "tap" event for the same? 

Thanks
Dave
0
Petyo
Telerik team
answered on 14 Mar 2013, 07:54 AM
Hello Dave,

The issue applies to all Kendo UI widgets. It is more or less a coincidence (which causes confusion) that DOM click and widget click events have the same names, and the DOM click event works on desktop. However, this is not something you should rely on, as our documentation thoroughly describes the way you should subscribe to widget events. 

Greetings,
Petyo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Dave
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Dave
Top achievements
Rank 1
Share this question
or