We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

show, hide the appointments of resources with CRUD

Hello,

I've been following the tutorial with the resources: https://ej2.syncfusion.com/aspnetcore/Schedule/Resource#/material .The appointments  show and hide with checkbox.
But when I changed to CRUD actions the appointments  doesn't hide  when you uncheck the resource . How can I do that with CRUD

This is the onChange of the checkboxes:
    function onChange() {
        var scheduleObj = document.getElementById('schedule').ej2_instances[0];
        var ownerOneObj = document.getElementById('emv').ej2_instances[0];
        var ownerTwoObj = document.getElementById('apo').ej2_instances[0];
        var ownerThreeObj = document.getElementById('pat').ej2_instances[0];
        var predicate;
        var checkBoxes = [ownerOneObj, ownerTwoObj, ownerThreeObj];
        checkBoxes.forEach(function (checkBoxObj) {
            if (checkBoxObj.checked) {
                if (predicate) {
                    predicate = predicate.or('CalendarId', 'equal', parseInt(checkBoxObj.value, 10));
                } else {
                    predicate = new ej.data.Predicate('CalendarId', 'equal', parseInt(checkBoxObj.value, 10));
                }
            }
        });
        scheduleObj.eventSettings.query = new ej.data.Query().where(predicate);
    }

I've also added the sample



Attachment: scheduler_with_database_c9cd93b9.rar

7 Replies

VD Vinitha Devi Murugan Syncfusion Team December 3, 2019 07:26 AM

Hi theofilos, 
 
Syncfusion Greetings. 
 
We have prepared the CRUD sample to show the appointments based on the check box selection and same can be available in below link. 
 
 
Kindly try with the above sample and let us know, if you need any further assistance on this. 
 
Regards, 
M.Vinitha devi 



VA Vasilis December 5, 2019 04:48 AM

I tried to download and got Access Denied.




HB Hareesh Balasubramanian Syncfusion Team December 6, 2019 06:34 AM

Hi Theofilos, 

Sorry for the inconvenience caused. 

Kindly try the below link for download the sample, 

Regards, 
Hareesh 



VA Vasilis December 10, 2019 05:45 AM

Hi,

I've tried the sample and it works great with 3 checkboxes.
But when I added more than 3 checkboxes it didn't work properly.
e.g. if I uncheck a property it doesn't hide the correct appointments.

You can check the sample. Thank you for your time

Attachment: JS2ScheduleSampleCRUDLOD_aed3bd3c.rar


HB Hareesh Balasubramanian Syncfusion Team December 11, 2019 11:30 AM

Hi Theofilos, 

Sorry for the inconvenience caused. 

Based on the requirement, we have modified your shared sample, which can be downloaded from the following link, 

Kindly try the above sample, if you have any concerns please revert us back for further assistance. 

Regards, 
Hareesh 



RA ransems April 25, 2020 01:02 PM

Any chance you can add the query as displayed in the literal ejs-schedule in the following:

I have:

@Html.EJS().Schedule("schedule").Width("100%").Height("685px").SelectedDate(DateTime.UtcNow).Timezone("UTC -04:00").Readonly(false).Resources(res =>
                                           {
                                               res.DataSource(ViewBag.Owners).Field("OwnerId").Title("OwnerSlug").Name("OwnerSlug").TextField("OwnerSlug").IdField("OwnerId").ColorField("Color").Add();
                                           }).EventSettings(es => es.DataSource(dataManger =>
                                           {
                                               dataManger.Url("/CrmAdmin/Resources/GetData").CrudUrl("/CrmAdmin/Resources/UpdateData").Adaptor("UrlAdaptor").CrossDomain(true);
                                           })).Render()




HB Hareesh Balasubramanian Syncfusion Team April 27, 2020 07:28 AM

Hi Ransems, 

Thanks for the update. 

We have ported the same CRUD sample in ASP.NET MVC platform and it can be downloaded from the following link, 


Kindly try the above sample and revert us if you have any further assistance. 

Regards, 
Hareesh 


Loader.
Live Chat Icon For mobile
Up arrow icon