ListView data-bind event not fired when endless-scroll = true

5 posts, 2 answers
  1. Dean
    Dean avatar
    73 posts
    Member since:
    Oct 2012

    Posted 08 Sep 2013 Link to this post

    Hi,

    I have defined a ListView declaritively like this:

    <ul data-role="listview" data-bind="source: myDataSource" data-template="myTemplate" data-bound="displayEmptyText" data-endless-scroll="true">
    </ul>

    The displayEmptyText function checks the number of data items in the DataSource and displays "No items available" if there are 0 items. This works when I set endless-scroll to false but doesn't fire the event when endless-scroll is true.

    Is this going to be fixed in a coming release? Is there a better way to achieve the display of the "No items available" message?

    Cheers

    Dean
  2. Dean
    Dean avatar
    73 posts
    Member since:
    Oct 2012

    Posted 08 Sep 2013 Link to this post

    I just realised this thread should have gone in the ListView section, can this be moved?
  3. Kendo UI is VS 2017 Ready
  4. Answer
    Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 11 Sep 2013 Link to this post

    Hi Dean,

    The data binding process of the listview widget is a bit different when virtual mode is enabled - indeed this is not documented well enough.  A good place to perform this check would be in the datasource change event handler. 

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Dean
    Dean avatar
    73 posts
    Member since:
    Oct 2012

    Posted 15 Sep 2013 Link to this post

    Will the data-bound event be fired in a future release?

    A general comment about this:
    If a list view with endless scrolling is going to continue to be so different, and break many of the normal list view's features, it really should be a separate widget. The amount of things that just don't work when endless scrolling is set to true is very frustrating.
  6. Answer
    Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 17 Sep 2013 Link to this post

    Hello Dean,

    you are spot on with this. This was our initial design direction. However, the ListView already supported (albeit incorrectly) endless scrolling and press to load more. Introducing another widget with the same features working in a different way would be even more confusing. 

    Unfortunately, the databound event has a special role when the widget is MVVM bound. Triggering that when scrolling would cause a significant performance penalty (as all DOM elements would be re-iterated). I do understand that this results in a certain level of inconsistency – this is purely due to implementation details which we can't change without causing big breaking changes in the current behavior. 

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready