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

How to make null of the Data Type Field blank display

6 Answers 662 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Ikou
Top achievements
Rank 1
Ikou asked on 24 Feb 2016, 03:03 AM

Hi,

This Gantt in has Custom Field called "actualStart".
The default value of this field is null, but the view at this time want to blank rather than a "null" string.
Do you have any way?

 

actualStart: {
    from: "actualStart",
    type: "date",
    defaultValue: null
},
....
 
columns: [
    { field: "title", title: "title" },
    { field: "actualStart", title: "actualStart", format: "{0:d}" },
],

thanks.

6 Answers, 1 is accepted

Sort by
0
Accepted
Bozhidar
Telerik team
answered on 24 Feb 2016, 08:20 AM
Hello,

The only way to show a different value than the actual one at the moment is to bind to the dataBound event of the gantt and manually acess the cell element and change it's html:
http://docs.telerik.com/kendo-ui/api/javascript/ui/gantt#events-dataBound

Regards,
Bozhidar
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Boyan
Top achievements
Rank 1
answered on 03 May 2019, 12:02 PM

Hi Bozhidar, 

I have the same problem and tried to resolve it using your advice, but unfortunatley I couldn't achieve it when having child tasks. If you check this example here (https://dojo.telerik.com/@bzpetkov/utIQAYAr/2), you'll see that the task2 contains a customColumn = "some", but its text is cleared as well. If you move task3 before task1, you won't have such problem. Could you please advise how to resolve this.

Thanks, Boyan.

0
Bozhidar
Telerik team
answered on 07 May 2019, 01:27 PM
Hi,

This happens due to the DOM becoming out-of-sync with the virtual dom tree that the Gantt uses for rendering, after the manual change of the text element.

Unfortunately this is a side effect that cannot be circumvented with this workaround. What I can advise is to try and edit the data service to return "" rather than null values for the custom fields.

Regards,
Bozhidar
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.
0
Boyan
Top achievements
Rank 1
answered on 07 May 2019, 07:22 PM

Hi Bozhidar.

First, Thanks for your quick reply.

Yes, I tried it with setting "", but there is another obstacle here. If your custom field is nullable date, and you use the "format" option of your custom column, you'll get another null no matter how you change the data :). In my oppinion the best is to have a template which will make the whole gantt even more powerfull. I found such request in the Progress project map, but it is low voted and it's normal because of the low gantt usage after all.

Best Regards, Boyan.

0
Bozhidar
Telerik team
answered on 10 May 2019, 05:16 AM
Hello,

I've increased our internal priority for the Cell Template feature of the Gantt, which would indeed address this issue. 

Regards,
Bozhidar
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.
0
Boyan
Top achievements
Rank 1
answered on 10 May 2019, 06:09 AM

Hi Bozhidar,

Sounds great. Thanks a lot for your support and professional attitude. :)

Best Regards, Boyan.

Tags
Gantt
Asked by
Ikou
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Boyan
Top achievements
Rank 1
Share this question
or