Declined
Last Updated: 19 Nov 2024 10:47 by ADMIN
Peter
Created on: 25 Oct 2019 06:48
Category: Grid
Type: Bug Report
0
If column value = "null" it is not displayed in grid
  • Create e.g. local data grid (id, name)
  • add 2 records => { id: 1, name: "null", id: 2, name: "Jack" }
  • Name column for id = 1 is empty

I have tested this on your example for local data grid. It can be applicable also for remote grid, treelist, etc.

 

Attached Files:
3 comments
ADMIN
Nikolay
Posted on: 19 Nov 2024 10:47

Hello Michael,`

Thank you for the feedback.

By design, the Grid considers all values with `null` as the JS primitive value `null`. The description of `null` is:

"The null value represents the intentional absence of any object value."

So the Grid shows an empty value when null is bound to a field.

However, this can be easily modified and adjusted according to the application's needs with the use of a template.

Regards,
Nikolay
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Michael D
Posted on: 12 Nov 2024 16:02

Sorry to hijack this old issue...
I have just stumbled across the same problem.

I do not understand why the described behaviour should be expected/intended. "Null" is just some string and should have nothing to do with null, meaning the absence of a value. E.g. in German, "Null" also means 0, this string could be used in a lot of different contexts where it has nothing to do with the JS null keyword.
This is why, in my opinion, treating null and "null" equally is misleading at best and dangerous at worst. Instead, I would expect cells with value null to be empty, while cells with value "null" to contain "null".

ADMIN
Tsvetomir
Posted on: 31 Oct 2019 10:32

Hi Peter,

Generally, displaying nothing when the value is "null" is the desired functionality. Since the majority of the common users of the application might not completely comprehend when the null text is shown. It would be more talkative if the cell is left empty.

In other words, the described behavior is not a bug, rather, it is an intentional functionality. What I can recommend if you would like to show the null text is to utilize the template option of the grid's column:

{ field: "ProductName", template:"#=ProductName? ProductName: 'null'#"},

I hope you find this helpful.

 

Kind regards,
Tsvetomir
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.