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

Binding Tap events after loading information from dataSource.

1 Answer 79 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Davin
Top achievements
Rank 1
Davin asked on 11 Nov 2013, 06:17 PM
I am following this demo:
http://demos.kendoui.com/mobile/scrollview/custom-template.html#/

What I am not able to figure out is how to bind a Tap event either after the new pages are rendered.

$('.
batch-page .gallery-page .tile').kendoTouch({tap: function (e) {
   alert('Hello")
}});

Normally I would just jquery's live on method, but I need the kendo tap binding.

1 Answer, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 13 Nov 2013, 10:11 AM
Hello Davin,

In order to achieve that you should bind to the change event of the ScrollView, get a reference to the array that holds the pages and create a .kendoTouch component on the element located at the current page.
Do not forget to destroy the previously created widgets on other pages.
function onChange(e) {
    var pages = this._content.pages;
 
    kendo.destroy(pages[0].element);
    kendo.destroy(pages[2].element);
 
    pages[1].element.find(".image").kendoTouch({
        tap: function(e) {
            console.log("tap!");
        }
    });
}


For your convenience I prepared a small example:

Regards,
Alexander Valchev
Telerik
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
Davin
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or