Hallo Kendo Team.
I have got incomming data, which contains null values. For example FirstName is empty (null).
Kendo grid display "null", but it is funny FirstName. I want to display "" (nothing) instead of "null".
Is there any way how to do it? ( without changing incoming data)
Thnx. uf.
I have got incomming data, which contains null values. For example FirstName is empty (null).
Kendo grid display "null", but it is funny FirstName. I want to display "" (nothing) instead of "null".
Is there any way how to do it? ( without changing incoming data)
Thnx. uf.
1 Answer, 1 is accepted
0
Hi Tak,
The functionality that you described could be achieved using a template. Since the template allows use of JavaScript code inside its definition, you could perform a simple check if the corresponding value is null and return an empty string. In this jsFiddle example you could see this approach in action.
Kind regards,
Alexander Valchev
the Telerik team
The functionality that you described could be achieved using a template. Since the template allows use of JavaScript code inside its definition, you could perform a simple check if the corresponding value is null and return an empty string. In this jsFiddle example you could see this approach in action.
Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Jakob Zetterström
commented on 26 Apr 2012, 09:12 AM
Top achievements
Rank 1
And for (batch) editing? Which kind of editor template do you propose?
Alexander Valchev
commented on 01 May 2012, 08:34 AM
Telerik team
Hello Jakob,
The default editor for date fields is a date picker widget.
If you want to define your own editor I suggest to follow the example from our custom editor demo and implement a editor function that best fits in your requirements. In case you are asking how to prevent the displaying of null values in batch editing mode, you could use the approach described in my previous post.
All the best,
Alexander Valchev
the Telerik team
The default editor for date fields is a date picker widget.
If you want to define your own editor I suggest to follow the example from our custom editor demo and implement a editor function that best fits in your requirements. In case you are asking how to prevent the displaying of null values in batch editing mode, you could use the approach described in my previous post.
All the best,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Jakob Zetterström
commented on 02 May 2012, 10:43 AM
Top achievements
Rank 1
Hi Alexander,
Umm... no, I can't use the approach described in your previous post. I use a custom DatePicker editor, and even though the model value is null, I can't keep the editor from displaying a "null" string value in its textbox when it is activated. Could you please update the fiddle to show how this is done with the grid simply set to editable = true?
Thanks,
Jakob
Umm... no, I can't use the approach described in your previous post. I use a custom DatePicker editor, and even though the model value is null, I can't keep the editor from displaying a "null" string value in its textbox when it is activated. Could you please update the fiddle to show how this is done with the grid simply set to editable = true?
Thanks,
Jakob
Alexander Valchev
commented on 04 May 2012, 08:11 AM
Telerik team
Hi Jakob,
I tested this scenario and everything seems to work as expected on my side.
Please check my sample page and let me know if I missed something.
Regards,
Alexander Valchev
the Telerik team
I tested this scenario and everything seems to work as expected on my side.
Please check my sample page and let me know if I missed something.
Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Felipe Casanova
commented on 01 Jul 2012, 02:48 PM
Top achievements
Rank 1
Alexander,
Are you suggesting that anywhere there is likely to be a null value that we have to use a template? This seems like more of a work-around than a way to solve the problem. Are there any plans to change this behaviour please? I can't think when displaying "null" to users is a good idea.
Thanks
Matt
Jesper
commented on 03 Jul 2012, 07:24 AM
Top achievements
Rank 1
I absolutely agree with Matt. We should not have to resort to templates to prevent the user from seeing a null value.
Alexander Valchev
commented on 04 Jul 2012, 02:29 PM
Telerik team
Hi guys,
I am afraid that at present we do not have plans to change the default behaviour, nevertheless be sure that I will forward your feedback to the team. What I can suggest at the moment, is to vote for this idea at Kendo user voice forum - if it turns out to be popular our team will look into it further.
Kind regards,
Alexander Valchev
the Telerik team
I am afraid that at present we do not have plans to change the default behaviour, nevertheless be sure that I will forward your feedback to the team. What I can suggest at the moment, is to vote for this idea at Kendo user voice forum - if it turns out to be popular our team will look into it further.
Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tim
commented on 06 Aug 2012, 11:12 PM
Top achievements
Rank 1
I totally agree with Matt and Jesper. This is not acceptable - especially for string values. Null strings should be displayed as '', not 'null'.
Additionally, there should be a property on the grid for a 'no-data' template.
Additionally, there should be a property on the grid for a 'no-data' template.
Muhanad
commented on 07 Aug 2012, 10:12 PM
Top achievements
Rank 1
Using template fixes the null issue but seems to create another issue in the cell where a null value exist. The column line on the left disappears on every cell that has a null value. This only happens ie....
Agree with everyone on this thread...I think this is a defect that needs some fixing :)
Agree with everyone on this thread...I think this is a defect that needs some fixing :)
Felipe Casanova
commented on 07 Aug 2012, 11:18 PM
Top achievements
Rank 1
Looks like enough votes were received. Following Alexanders vote link shows that this behaviour has been changed and it will be included in the next official release.
Matt
Rodney
commented on 27 Aug 2012, 08:12 PM
Top achievements
Rank 2
So how would you do this using a row template?
Dimo
commented on 28 Aug 2012, 08:42 AM
Telerik team
Hi Rodney,
You should use a template with an expression (IF statement) inside.
http://demos.kendoui.com/web/templates/expressions.html
("Using JS code in the template definition")
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/faq
("How do I have conditional logic in a column client template?")
Regards,
Dimo
the Telerik team
You should use a template with an expression (IF statement) inside.
http://demos.kendoui.com/web/templates/expressions.html
("Using JS code in the template definition")
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/faq
("How do I have conditional logic in a column client template?")
Regards,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Kjell Ivar
commented on 23 Oct 2012, 10:07 AM
Top achievements
Rank 1
Hello.
I wonder what is the status for this issue.
Is this going to be included in the next release of KendoUI? And eventually when will that be? I totally agree with the other people here that this is a important issue to be fixed. It is not a good solution to include templates for all fields that need to display '' instead of null.
I wonder what is the status for this issue.
Is this going to be included in the next release of KendoUI? And eventually when will that be? I totally agree with the other people here that this is a important issue to be fixed. It is not a good solution to include templates for all fields that need to display '' instead of null.
Dimo
commented on 23 Oct 2012, 10:48 AM
Telerik team
Hello Kjell Ivar,
The fix is already available in the Q2 2012 SP1 release (2012.2.913).
Greetings,
Dimo
the Telerik team
The fix is already available in the Q2 2012 SP1 release (2012.2.913).
Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Jon
commented on 02 Jan 2013, 04:04 PM
Top achievements
Rank 1
....which still does not work if the value is set via ClientTemplate.
Atanas Korchev
commented on 02 Jan 2013, 04:27 PM
Telerik team
Hello,
Atanas Korchev
the Telerik team
The grid give full control to the client template. Checks for null should be performed in the template.
Kind regards,Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Travis
commented on 06 Mar 2013, 09:05 PM
Top achievements
Rank 1
I too would be in favor of making '' the default behavior. Still doesn't seem to be the default when using the web 2013 version.
Atanas Korchev
commented on 07 Mar 2013, 06:53 AM
Telerik team
Hi Travis,
Atanas Korchev
the Telerik team
Here is a live demo showing that null values are not displayed by default (using the latest official version): http://jsbin.com/obikoq/1/edit
And here is the same example using the Q1 2013 beta version: http://jsbin.com/okopaz/1/edit
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Travis
commented on 07 Mar 2013, 03:14 PM
Top achievements
Rank 1
My mistake. I'm using an older version for the Kendo UI controls. I confused this with another project I was working on. Sorry!
Brady
commented on 09 Jun 2013, 11:15 AM
Top achievements
Rank 1
That second example (Q1 2013 beta version) is utterly useless. It doesn't show the column or template definition.