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

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

3 Answers 55 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Ruud
Top achievements
Rank 1
Ruud asked on 30 Sep 2015, 07:29 AM

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

 

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 02 Oct 2015, 08:00 AM

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!
 
0
Ruud
Top achievements
Rank 1
answered on 02 Oct 2015, 09:50 AM

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

0
Kiril Nikolov
Telerik team
answered on 02 Oct 2015, 10:19 AM

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!
 
Tags
ListView (Mobile)
Asked by
Ruud
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Ruud
Top achievements
Rank 1
Share this question
or