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

Gantt CustomView Range Time

6 Answers 369 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Liu
Top achievements
Rank 1
Liu asked on 21 Dec 2017, 08:45 AM

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

6 Answers, 1 is accepted

Sort by
0
Liu
Top achievements
Rank 1
answered on 22 Dec 2017, 02:56 AM

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] #"),

 

0
Veselin Tsvetanov
Telerik team
answered on 22 Dec 2017, 12:05 PM
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.
0
Liu
Top achievements
Rank 1
answered on 25 Dec 2017, 02:12 AM

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

 

0
Dimitar
Telerik team
answered on 26 Dec 2017, 11:37 AM
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.
0
Vaishali
Top achievements
Rank 1
answered on 11 Sep 2019, 09:21 PM
Do we have that option to create custom view other than that are available (Days, Year and month)
0
Dimitar
Telerik team
answered on 13 Sep 2019, 05:56 AM

Hello Vaishali,

There is an existing HowTo example in the documentation that demonstrates how a simple "Quarterly" custom view could be created for the Gantt. You could use the below link for reference:

Regards,
Dimitar
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.
Tags
Gantt
Asked by
Liu
Top achievements
Rank 1
Answers by
Liu
Top achievements
Rank 1
Veselin Tsvetanov
Telerik team
Dimitar
Telerik team
Vaishali
Top achievements
Rank 1
Share this question
or