triggering back button to listview collapses my list

6 posts, 0 answers
  1. Young
    Young avatar
    13 posts
    Member since:
    Nov 2013

    Posted 02 Jan 2014 Link to this post

    Seems there's an issue with back button to listview. Below listview renders fine with load more button and pull to refresh works fine.
    However, when i click any list (to show detail content), it shows the detail fine... but when clicking the back button in the header, my listview is collapsed and shows the last item only (all the rest items are below the last item, so it is all collapsed). When i take pull to refresh action, then the listview shows normal.

    have any clue???

    <div data-role="view"
                data-id="notes-view"
                data-layout="main-layout"
                data-title="Notes"
                data-show="app.showListview"
                id="my-notes-view">
                <ul id="note-listview"
                    class="listview"
                    data-role="listview"
                    data-pull-to-refresh="true"
                    data-load-more="true"
                    data-source="app.noteDS"
                    data-template="notesTemplate"></ul>
            </div>


    app.noteDetail = function(e){
            var view = e.view,
                noteDetailTemplate = kendo.template($("#noteDetailTemplate").text());
     
            app.noteDS.fetch(function(){
                item = app.noteDS.get(view.params.id); //this is actually fetching from ajax...
                view.scrollerContent.html(noteDetailTemplate(item));
                kendo.mobile.init(view.content);
            });
        };
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 06 Jan 2014 Link to this post

    Hi Young,

    Most probably the problem comes from the fact that when you invoke kendo.mobile.init() you are initializing all the widgets again, which causes the behavior that you observer. All Kendo UI Mobile widgets should be initialized just once and if they are initialized again errors are expected.

    As I can see that you are changing the template, why don't you just use the data binding option of the widget?

    Regards,
    Kiril Nikolov
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  3. Kendo UI is VS 2017 Ready
  4. Young
    Young avatar
    13 posts
    Member since:
    Nov 2013

    Posted 07 Jan 2014 Link to this post

    so instead of init, what should i call? this code i followed the sample codes from sushi application.
  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 10 Jan 2014 Link to this post

    Hello Young,

    I am not really sure what exactly do you want to achieve in your project. Usually the recommended way to instantiate a new Kendo UI Mobile application is using new kendo.mobile.Application() method, as shown in our demos

    Regards,
    Kiril Nikolov
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
  6. Young
    Young avatar
    13 posts
    Member since:
    Nov 2013

    Posted 13 Jan 2014 Link to this post

    my goal here is to load remote data to a listview and once user click's the button from the list to see the detail, I want to load the content, render custom template and show the detail to user. With having back button shown in detail page, should be able to go back to the listview easily.

    So I have the listview working, however; when visiting the detail page (repeatedly from listview going back and forth) going back to the listview sometimes gets collapsed. That's my problem.

    If you can show me a good example of showing detail information from listview (with also has endless scrolling), that should be good enough.
  7. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 16 Jan 2014 Link to this post

    Hi Young,

    You can check the following demo, showing how to show an item information in a different view:

    http://demos.kendoui.com/mobile/listview/editing.html

    You should be able to enable endless scrolling for the ListView (with the correct configuration) as well.

    Regards,
    Kiril Nikolov
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
Back to Top
Kendo UI is VS 2017 Ready