How to make null of the Data Type Field blank display

7 posts, 1 answers
  1. Ikou
    Ikou avatar
    12 posts
    Member since:
    Aug 2015

    Posted 23 Feb 2016 Link to this post

    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.

  2. Answer
    Bozhidar
    Admin
    Bozhidar avatar
    1192 posts

    Posted 24 Feb 2016 Link to this post

    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!
     
  3. Boyan
    Boyan avatar
    19 posts
    Member since:
    Mar 2018

    Posted 03 May 2019 Link to this post

    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.

  4. Bozhidar
    Admin
    Bozhidar avatar
    1192 posts

    Posted 07 May 2019 Link to this post

    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.
  5. Boyan
    Boyan avatar
    19 posts
    Member since:
    Mar 2018

    Posted 07 May 2019 in reply to Bozhidar Link to this post

    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.

  6. Bozhidar
    Admin
    Bozhidar avatar
    1192 posts

    Posted 10 May 2019 Link to this post

    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.
  7. Boyan
    Boyan avatar
    19 posts
    Member since:
    Mar 2018

    Posted 10 May 2019 in reply to Bozhidar Link to this post

    Hi Bozhidar,

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

    Best Regards, Boyan.

Back to Top