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

triggering back button to listview collapses my list

5 Answers 21 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Young
Top achievements
Rank 1
Young asked on 02 Jan 2014, 06:11 PM
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);
        });
    };

5 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 06 Jan 2014, 12:02 PM
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.
0
Young
Top achievements
Rank 1
answered on 08 Jan 2014, 02:40 AM
so instead of init, what should i call? this code i followed the sample codes from sushi application.
0
Kiril Nikolov
Telerik team
answered on 10 Jan 2014, 12:56 PM
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.
0
Young
Top achievements
Rank 1
answered on 13 Jan 2014, 05:37 PM
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.
0
Kiril Nikolov
Telerik team
answered on 16 Jan 2014, 08:51 AM
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.
Tags
General Discussions
Asked by
Young
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Young
Top achievements
Rank 1
Share this question
or