BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi Otto ,
Thank you for using Sycnfusion products.
Yes it is possible to refresh the datasource for the Gantt control without reloading the page . We have prepared a sample for refreshing the Gantt control with different datasource using the combobox selection changed event . Also the ‘.Datasource’ property of the Gantt control will be as an object and it can be retrieved using the below code snippet ,
Code snippet :
@(Html.EJ().Gantt("Gantt") .TaskIdMapping("TaskID") .ChildMapping("Children") //... .Datasource(ViewBag.datasource) )
var data = $("#Gantt").data("ejGantt").model.dataSource; |
Please find the sample in the below location .
Sample Location : http://www.syncfusion.com/downloads/support/directtrac/118044/MVC09NewSample-2058353859.zip
Please let us know if you need more information on this.
Thanks,
Bharath.
Hi Otto,
Thanks for the update.
We would like to let you know that, we can customize the column with combo box in Gantt control with the drop down data source.
1. Using resourceInfoMapping property
Please refer the following code snippets for more details.
Code snippets:
In Index.cshtml:
@(Html.EJ().Gantt("Gantt") .TaskIdMapping("Id") .TaskNameMapping("Name") //... .ShowResourceNames(true) .ResourceInfoMapping("Resources") .ResourceNameMapping("Name") .ResourceIdMapping("Id") .Resources(ViewBag.resources) .Datasource(ViewBag.datasource) )
@(Html.EJ().ScriptManager())
|
In GanttController.cs:
namespace MVC09NewSample.Controllers { public class GanttController : Controller { // // GET: /Gantt/
public ActionResult Index() { var DataSource = ResourceDataSource.GetData(); ViewBag.datasource = DataSource; var Resources = ResourceList.GetData(); ViewBag.resources = Resources; return View(); } public class ResourceList { public static List<ResourceListData> GetData() { List<ResourceListData> list = new List<ResourceListData>();
list.Add(new ResourceListData() { Id = 1, Name = "Resource1" }); list.Add(new ResourceListData() { Id = 2, Name = "Resource2" }); list.Add(new ResourceListData() { Id = 3, Name = "Resource3" }); list.Add(new ResourceListData() { Id = 4, Name = "Resource4" }); list.Add(new ResourceListData() { Id = 5, Name = "Resource5" }); list.Add(new ResourceListData() { Id = 6, Name = "Resource6" }); list.Add(new ResourceListData() { Id = 7, Name = "Resource7" }); return list; } } public class ResourceListData { public int Id { get; set; } public string Name { get; set; } } public class ResourceDataSource {
public static List<ResourceData> GetData() { List<ResourceData> list = new List<ResourceData>(); list.Add(new ResourceData() { Id = 1, Name = "Task 1", StartDate = "02/23/2014", //... Resources = new List<int>() { 1, 2, 4, 5 },
//... } })
}); return list; } } |
We have prepared a sample based on this and you can find the sample under the following location:
Sample: http://www.syncfusion.com/downloads/support/directtrac/118044/MVC09NewSampleResource812621839.zip
2. Using “load” client side event.
At present we are facing some issues in editing custom column with combo box. So we have logged an issue report “Issue in editing custom column with combo box”. The fix for the issue will be available in our upcoming service pack 2 release, which is expected to be out at the end of February 2015.
We would also like to inform you that, we can also provide a custom patch for this issue by February 17, 2014 if you are in need of a solution earlier.
Please refer the following code snippets for more details.
Code snippets:
@(Html.EJ().Gantt("Gantt") .TaskIdMapping("Id") .TaskNameMapping("Name") //... .ClientSideEvents(eve => { eve.Load("load"); }) .Datasource(ViewBag.datasource) )
@(Html.EJ().ScriptManager())
<script type="text/javascript">
//Data for DropDown var dropData = ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5"];
function load(args) { var columns = this.getColumns();
columns.splice(2, 0,
{
field: "text",
headerText: "Product",
editType: "dropdownedit",
dropdownData: dropData,
width: "180px"
});
}
</script> |
We have also prepared a sample based on this and you can find the sample under the following location:
Sample: http://www.syncfusion.com/downloads/support/directtrac/118044/MVC09NewSampleLoad230366319.zip
Please let us know if you require further assistance on this.
Regards,
John. R
Hi Otto,
We have already logged an issue report “Issue in editing custom column with combo box” and the same has been shared in the previous update. Now we have created incident "# 134550" for the better follow-up of this reported issue. Our support engineer will assist you through incident under your Direct Trac account.
Our Direct Trac support system can be accessed from the following link:
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents
Regards,
John. R