Scheduler hide/show selected grouping resources

1 Answer 17 Views
Scheduler
Francisco Roldan
Top achievements
Rank 1
Francisco Roldan asked on 19 Mar 2025, 12:22 PM

Hi, I tried a lot of things and code i found here in the forum and in the documentations, but everything i found is for Jquery and it isnt working for .net core.

I have some checbkox to filter and show/hide the resources of my scheduler. The filtering is working, but i cant hide/show the selected/unselected resources.

Until the line 'scheduler.dataSource.filter(filter);' all is working fine, filtering the events. But i dont want to have the columns of the resources that arent selected... I found in a lot of topics that for that, i need the line 'scheduler.view(scheduler.view().name)' but is not working.

I found that for filter the datasource some people use 'scheduler.resources[0].dataSource.filter(filter);' but is not working for me, im using 'scheduler.dataSource.filter(filter)'.

How could i get that functionality? I need it... because i have a lot of 'medicos' resources and is impossible to visualize the scheduler with all.. i only need the selected ones.

Thanks in advance!

 

$("#medicosCheck :checkbox").change(function (e) {
    var checked = $.map($("#medicosCheck :checked"), function (checkbox) {
        return parseInt($(checkbox).val());
    });

    var filter = {
        logic: "or",
        filters: $.map(checked, function (value) {
            return {
                operator: "eq",
                field: "IdMedico",
                value: value
            };
        })
    };

    var scheduler = $("#citas").data("kendoScheduler");
    scheduler.dataSource.filter(filter);
    //scheduler.view(scheduler.view().name);
});

 

1 Answer, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 24 Mar 2025, 07:19 AM

Hi Francisco Roldan,

Thank you for the details provided.

I have created a sample application implementing a Scheduler that is filtered using a ComboBox, and the functionality operates as expected. Within the ComboBox Changeevent, the selected value is retrieved, and the Scheduler resources are filtered by using the filter method of the dataSource.

function onChange(e){
    var value = e.sender.value();
    var scheduler = $("#scheduler").data("kendoScheduler");
    console.log(value);
    if(value != ""){

        var filter = {
            operator: "eq",
            field: "OwnerID",
            value: parseInt(value)
        };
        scheduler.dataSource.filter(filter);
    }

    else {
        console.log("here")
        scheduler.dataSource.filter({});
    }
}

Please let me know if this is the desired result. If this is not the case, please provide more information or reproduce your code in the attached application. This way, I could debug the implementation on my end and provide more accurate and precise solution.

I hope this information was helpful and I look forward to your reply.

Regards,
Ivaylo
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Tags
Scheduler
Asked by
Francisco Roldan
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Share this question
or