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