How to show an "Empty list view" template

3 posts, 1 answers
  1. Ruud
    Ruud avatar
    51 posts
    Member since:
    Oct 2012

    Posted 23 Nov 2014 Link to this post

    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. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 26 Nov 2014 Link to this post

    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.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Ruud
    Ruud avatar
    51 posts
    Member since:
    Oct 2012

    Posted 05 Mar 2015 in reply to Alexander Valchev Link to this post

    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!
Back to Top