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

Problem with moveEnd event with filtered resources

6 Answers 141 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
salvador
Top achievements
Rank 1
salvador asked on 28 Oct 2013, 11:24 AM
Hello everybody,

    First of all, excuse my low English level.

    In the scheduler I have added resources with check boxes like the basic usage demo. Also a group for these resources (each attendee is a group), and you can  to hide the group when you uncheck the resource (filtering the resources).
$("#scheduler").kendoScheduler({
...
    group: {
         resources: ["Atendees"],
             orientation: "vertical"
    },
    resources: [
          {
              field: "atendees",
              name: "Atendees",
              dataSource: [
                  { text: "Alex", value: 1, color: "#f8a398" },
                   { text: "Bob", value: 2, color: "#51a0ed" },
                   { text: "Charlie", value: 3, color: "#56ca85" },
                             .
                             .
                             .
               ],
               title: "Atendees"
         }
    ]
...
});
 
$("#people :checkbox").change(function(e) {
  var checked = $.map($("#people :checked"), function(checkbox) {
      return $(checkbox).val();
  });
    
  var filter = {
    logic: "or",
    filters: $.map(checked, function(value) {
      return {
        operator: "eq",
        field: "value",
        value: value
      };
    })
  };
    
  var scheduler = $("#scheduler").data("kendoScheduler");
  scheduler.resources[0].dataSource.filter(filter);
  scheduler.view(scheduler.view().name);
});
    I have problems when I move events, because the field atendees returned ignores the filtered resources. Same with the param e.resources in moveEnd event method.

   For example, If I have 10 resources and are hidden from 1 to 5, If I move an event from resource 5 to 6 (the first and second that are showed), then returns the value 2 as the destiny resource when really would be the value 6, ignores the filtered resources.

    I could attach the complete code if it is necessary.

Thank you very much

6 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 30 Oct 2013, 11:56 AM
Hi Salvador,

I am not sure I understand exactly what you are trying to achieve. Could you please provide a runnable project where the issue is reproduced and a step by step test scenario? This would help us identify the issue and advise you further.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
salvador
Top achievements
Rank 1
answered on 30 Oct 2013, 12:52 PM
Hello Alexander,

The problem is that moveEnd event has a wrong e.resources value.

I use group and resource. If I filter the resources dataSource, then there are several hidden resources. But when you move the event from a resource group to another one, the e.resources has the value of the resource like they are showed all resources.

In the code attached, If you uncheck the Tech1 checkbox then it is not showed. Later if you move an event from Tech3 group to other day in the same Tech3 group, then incorrectly the event pass to Tech2 group. It is like you are showed all the resources without filter.

How could be obtained the correct value of e.resources?

Thank you very much
0
Alexander Popov
Telerik team
answered on 01 Nov 2013, 11:09 AM
Hello Salvador,

Thank you for the example. I reviewed it and found out that the moveEnd event indeed has wrong e.resources values. I reported the issue to our developers and it will be fixed, however at this point I cannot say exactly when.
I would recommend you regularly checking our internal builds and the KendoUI roadmap for additional information.
As a small sign of our appreciation for bringing this to our attention I have updated your Telerik points.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Kevin
Top achievements
Rank 1
answered on 21 Oct 2014, 03:47 PM
Seeing the same thing here with the current released version of kendo - any update for this bug fix?
0
Kevin
Top achievements
Rank 1
answered on 21 Oct 2014, 07:32 PM
fyi for those struggling with this... 
I was able to get the bound resources for a slot by creating a local event in the moveEnd method to get the x,y coords and ultimately call the schedulers methods to get the slotByPosition and finally the resourcesBySlot i.e.

var evt = window.event;
var x = evt.clientX;
var y = evt.clientY;
var slot = $("#scheduler").data("kendoScheduler").slotByPosition(x, y);
var resources = $("#scheduler").data("kendoScheduler").resourcesBySlot(slot);

resources now has the bound resource properties for the given slot...

thanks for completely ignoring this for the last year kendo...

0
Alexander Popov
Telerik team
answered on 23 Oct 2014, 11:31 AM
Hi Kevin,

The issue was fixed and included in an internal build shortly after it came to our attention. I could not reproduce it with recent versions of Kendo UI. Here are examples:
Could you please provide more details about the problem you are having and if possible - share a runnable sample project where it is reproduced? This would allow us to quickly identify what causes it and suggest a suitable solution.

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