Hi,
What is the best approach to create a mechanic to show an "No results found" template for a mobile list view? Of course, I could use client side script for this, but I'm just wondering if there is another, more generic way of doing this..
2 Answers, 1 is accepted
0
Accepted
Alexander Valchev
Telerik team
answered on 26 Nov 2014, 09:05 AM
Hi Ruud,
Thank you for contacting us.
Mobile ListView do not have a build-in template that will be displayed when there are no items. I assume that you are binding the widget to a remote DataSource via Ajax. Is that correct? In such case please use a client side script - all you need to do is to hook up to the dataBound event of the ListView and check if dataSource.data().length is equal to zero. If the condition is true append a dummy ListView item that notifies the user that there are no records.
The dummy record will be automatically removed when the dataSource changes (for example when the user searches for another word).
I hope this approach will fit in your scenario.
Regards,
Alexander Valchev
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Hi,
Thanks for your email. I did do the check in the databound event to conditionally show/hide a div with the text" nothing found". So thanks for your suggestion!