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

Endless Scroll Taps

1 Answer 55 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 27 Nov 2012, 04:19 AM
I have the following template: 
        <script type="text/x-kendo-template" id="recentPostListViewTemplate">
            <div id="#= id #" data-role="touch" data-tap="myTouch.tap">#= title #</div>
            <div class="articleBody" id="body-#= id #">
            #= content #<br>
            <a href=#= custom_fields.syndication_permalink[0] #>Read Full Story</a>
            </div>
        </script>
It works great at first. Once I add to the list view using endless scroll the newly generated items aren't tappable. This is my myTouch section:
window.myTouch = {
    tap : function(e) {
        var id = e.touch['target']['context']['id'];
        console.log(id);
        $('#body-' + id).toggle();
    }
}
Is there something I have to do to get this to work on the newly generated list view items? I tried the old stand by of an onClick event but just doesn't work right on the iPhone.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 29 Nov 2012, 08:55 AM
Hi Richard,

I would like to recommend using the ListView click event instead, as it pretty much does the same as what you are trying to implement. 

All the best,
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
ListView (Mobile)
Asked by
Richard
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Share this question
or