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

Problem with resizing a gantt task despite lack of such operation on a chart.

1 Answer 190 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Piotr
Top achievements
Rank 1
Piotr asked on 04 Nov 2014, 11:47 AM
Hi
I’ve found a kind of weird behaviour that occurs during change a progress value directly on a gantt chart, when after it, end of date is also changing. I tried to debug this scenario, to exclude bug on my webservices side. But in the same controller i cannot see any what supposed to be wrong. In a tracing, values to be set in business logic was fine.

My model responsible for read/update looks like:

 public class GetTasksController : ApiController
    {        
        public IEnumerable<DCProdTask> Get()
        {
            Soneta.Business.App.Login t = WebApiApplication.EnovaLogin;

            using (Session sesja = t.CreateSession(true, false))
            {
                DritProdukcjaModule PM = DritProdukcjaModule.GetInstance(sesja);
                return PM.ProdTasks.CreateView()
                                 .Cast<ProdTask>()
                                 .Select(x => Mapper.Map<ProdTask, DCProdTask>(x));               
            }
        }
       
      
        public async Task<DCProdTask> Get([FromUri] ModelType value, string type)        
        {            
            IList<DCProdTask> persons = new System.Web.Script.Serialization.JavaScriptSerializer()
                .Deserialize<IList<DCProdTask>>(value.models);
            DCProdTask[] arr = persons.ToArray<DCProdTask>();
            DCProdTask task = arr[0];            
            Soneta.Business.App.Login l = WebApiApplication.EnovaLogin;
            List<ProdTask> list = new List<ProdTask>();
            switch (type)
            {
                case "Update":  using (Session sesja = l.CreateSession(false, false))
                    {
                        using (ITransaction t = sesja.Logout(true))
                        {
                            DritProdukcjaModule PM = DritProdukcjaModule.GetInstance(sesja);
                            Soneta.Business.View view = PM.ProdTasks.CreateView();
                            view.Condition &= new FieldCondition.Equal("ID", task.ID);
                            view.LoadingRowsCount = 1;
                            ProdTask PTask = (ProdTask)view.GetFirst();
                            if (PTask != null)
                            {
                                DateTime _start = Convert.ToDateTime(task.Start);
                                DateTime _end = Convert.ToDateTime(task.End);
                                Soneta.Types.Percent _percentComplete =
                                    new Soneta.Types.Percent(Convert.ToDecimal(task.PercentComplete));
                                PTask.DataOd = new Soneta.Types.Date(_start);
                                PTask.CzasOd = new Soneta.Types.Time(_start.Hour, _start.Minute);
                                PTask.DataDo = new Soneta.Types.Date(_end);
                                PTask.CzasDo = new Soneta.Types.Time(_end.Hour, _end.Minute);
                                PTask.PercentComplete = _percentComplete;
                                list.Add(PTask);
                            }
                            t.CommitUI();

                        }
                        sesja.Save();
                        sesja.InvokeChanged();
                    }
                    break;
                default: break;
            }
            return  Mapper.Map<ProdTask, DCProdTask>(list.ToArray<ProdTask>()[0]);                         
        }




I’ve attached a couple of screenshots to show a fake values providing to web service through the url, and response as JSON. What is curious, it only happen on a tasks with small data intervals between start and end. When i have huge gantt tasks and i change progress from Month view, i have not noticed such behaviour.


1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 06 Nov 2014, 06:55 AM
Hi,

We haven't encountered such problem at our side. In case the task representation in the timeline is too narrow, it is possible that the drag handle for the resize is activated during drag operation of the task progress update.

Regards,
Dimitar Terziev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Gantt
Asked by
Piotr
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or