Simple mobile listview template: generic approach to avoid displaying 'null' requested

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

    Posted 30 Sep 2015 Link to this post

    Hi,

    I saw several discussions targeting other Kendo controls, but I did not see this particular question for the mobile listview. It is quite simple; I use the JayData "asKendoDataSource" function to get data from the local db and hook it up to a mobile listview. A simple template is showing the fields in format:

    <td> #=CustomerCode#</td>

    I know i can modify the values displayed by using a generic js function within the template like this:

    <td>#= CheckNull(CustomerDesc)#</td>

    But this means I need to embed this CheckNull in all of my templates (since I use deep model nesting it will get pretty ugly). Is there really no ​other elegant way? Seems ​quite a no brainer that 'null' values ​should not be displayed. ​I understood this behavior is already fixed for the Kendo grid; just wondering if it is possible for the listview as well.

    Best regards,

    Ruud

     

  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 02 Oct 2015 Link to this post

    Hello Ruud,

     

    This is the default behavior of the templates, and it is valid for all the widgets using the Kendo UI Templates. If I understand you correctly - the problem is that you do not want to display null values. If this is the case then you can perform a simple inline check like this:

     

    http://dojo.telerik.com/efaYi

     

    Regards,
    Kiril Nikolov
    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
  4. Ruud
    Ruud avatar
    51 posts
    Member since:
    Oct 2012

    Posted 02 Oct 2015 in reply to Kiril Nikolov Link to this post

    Hi Kiril,

    Thanks for the feedback; I already implemented a javascript function which i can re use for all templates. This means a lot of overhead code of course. I probably need to raise something at UserVoice; I cannot imagine there is any solution which wants to explicitly display the value "null" to users in their display templates.

    Regards,

    Ruud

  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 02 Oct 2015 Link to this post

    Hello Ruud,

     

    You can submit this as a feature request on UserVoice, so that it is considered for implementation in a future release.

     

    Regards,
    Kiril Nikolov
    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