Problem with moveEnd event with filtered resources

7 posts, 0 answers
  1. salvador
    salvador avatar
    17 posts
    Member since:
    Oct 2013

    Posted 28 Oct 2013 Link to this post

    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
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1442 posts

    Posted 30 Oct 2013 Link to this post

    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!
  3. salvador
    salvador avatar
    17 posts
    Member since:
    Oct 2013

    Posted 30 Oct 2013 Link to this post

    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
  4. Alexander Popov
    Admin
    Alexander Popov avatar
    1442 posts

    Posted 01 Nov 2013 Link to this post

    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!
  5. Kevin
    Kevin avatar
    3 posts
    Member since:
    Jan 2012

    Posted 21 Oct 2014 Link to this post

    Seeing the same thing here with the current released version of kendo - any update for this bug fix?
  6. Kevin
    Kevin avatar
    3 posts
    Member since:
    Jan 2012

    Posted 21 Oct 2014 in reply to Kevin Link to this post

    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...

  7. Alexander Popov
    Admin
    Alexander Popov avatar
    1442 posts

    Posted 23 Oct 2014 Link to this post

    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!
     
Back to Top