Gantt CustomView Range Time

5 posts, 0 answers
  1. Liu
    Liu avatar
    8 posts
    Member since:
    Nov 2016

    Posted 21 Dec 2017 Link to this post

    Hi,

    I want to set the start time and end time  with remote data in Gantt CustomView,

    so i call ajax then put them into "range" function, But the result  show out "undefined", 

    my code bellow: 

      kendo.ui.GanttCustomView = kendo.ui.GanttView.extend({
                name: "custom",
                options: {
                    yearHeaderTemplate: kendo.template("#=kendo.toString(start, 'yyyy')#"),
                    quarterHeaderTemplate: kendo.template("# return ['Q1', 'Q2', 'Q3', 'Q4'][start.getMonth() / 3] #")
                },
                range: function(range) {
                    var startD = '';
                    var endD = '';
                    $.ajax({
                        type: "post",
                        url: "@Href("~/Home/GetMinAndMaxDate/")",
                        data: { 'EmpNo': @Model.EmpNo },
                        async: false,
                        success: function (data) {
                            startD = data.split(";")[0];
                            endD = data.split(";")[1];
                        },
                        error: function () { alert("edit Error") }
                    });
                    this.start = new Date(startD);
                    this.end = new Date(endD);        
                },

    Shouldn't I do this? And how to set the date in remote way?

    Thanks,

    Liu

  2. Liu
    Liu avatar
    8 posts
    Member since:
    Nov 2016

    Posted 21 Dec 2017 Link to this post

    Hi,

    And what should  i do to make quarterHeader with year  like  "Q4,2015"  "Q1,2016"

    i try to do somthing like this

     quarterHeaderTemplate: kendo.template("# return ['Q1', 'Q2', 'Q3', 'Q4'][start.getFullYear()][start.getMonth() / 3] #"),

     

  3. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    824 posts

    Posted 22 Dec 2017 Link to this post

    Hi Liu,

    As you are requesting the start and end dates of the Range from a remote, I would suggest you to set them after the initialization of the widget. Here you could find a simple example, demonstrating the above suggestion on the default Gantt views.

    Concerning the header template of the custom view, if you need any further assistance on this task, I would recommend you our Professional services. That team is focused on providing tailor-made solutions as per customer requirements. Let me know if you are interested in cooperating with our colleagues and I will arrange someone from the team to contact you directly.

    Regards,
    Veselin Tsvetanov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  4. Liu
    Liu avatar
    8 posts
    Member since:
    Nov 2016

    Posted 24 Dec 2017 in reply to Veselin Tsvetanov Link to this post

    HI Veselin Tsvetanov,

    I still need to solve this issue of  header template of the custom view,

    Please let me know the contact info of your colleagues.

    Thanks,
    Liu

     

  5. Dimitar
    Admin
    Dimitar avatar
    459 posts

    Posted 26 Dec 2017 Link to this post

    Hello Liu,

    Thank you for getting back to us. 

    I have forwarded your request to the Professional Services Team. Expect a representative of the team to contact you shortly after the holidays to initiate the discussion.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top