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

Updating flat listview by using jQuery.html()?

1 Answer 60 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 1
Jack asked on 28 Aug 2013, 03:24 PM
Is it possible to update a listview by just using HTML, instead of the dataSource (which I think is a very inefficient method)? For instance, if I had a ul called "output," could I just update that from HTML fetched via AJAX via jQuery.html()?

This kind of worked before, but sometimes the listview wasn't refreshing.  Please add something like jQuery mobile's listview.refresh().

Also, when I switched to the flat listview as opposed to native, it updated, but I got this Javascript error:

Uncaught SyntaxError: Unexpected string
(anonymous function) st.extend.globalEval st.fn.extend.domManip st.fn.extend.append S.extend._createRemoteView
(anonymous function) f p.fireWith r r





1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 30 Aug 2013, 09:03 AM
Hello Jack,

Direct replacement of widget's HTML mark-up is not supported. The correct way to refresh ListView is by changing its data/DataSource. In this way the component will automatically be notified and forced to re-render with the new data.

May I know what are your reasons for not using the standard approach? What problems you encountered with it? Probably I will be able to suggest alternative solution if such is possible of course.

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
ListView (Mobile)
Asked by
Jack
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or