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

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

4 Answers 156 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 09 Sep 2013, 12:29 AM
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

4 Answers, 1 is accepted

Sort by
0
Dean
Top achievements
Rank 1
answered on 09 Sep 2013, 03:47 AM
I just realised this thread should have gone in the ListView section, can this be moved?
0
Accepted
Petyo
Telerik team
answered on 11 Sep 2013, 06:38 AM
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!
0
Dean
Top achievements
Rank 1
answered on 16 Sep 2013, 02:47 AM
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.
0
Accepted
Petyo
Telerik team
answered on 17 Sep 2013, 07:18 AM
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!
Tags
ListView (Mobile)
Asked by
Dean
Top achievements
Rank 1
Answers by
Dean
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or