Updating flat listview by using jQuery.html()?

2 posts, 0 answers
  1. Jack
    Jack avatar
    6 posts
    Member since:
    Aug 2013

    Posted 28 Aug 2013 Link to this post

    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





  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 30 Aug 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
Back to Top