Search appointments

Hi,

How can I search and appointments in scheduler control. 

I saw this example but couldn't understand how it works.

https://ej2.syncfusion.com/demos/schedule/search-events/

Thanks.

MC

5 Replies 1 reply marked as answer

NR Nevitha Ravi Syncfusion Team April 6, 2021 05:41 AM UTC

Hi Maikel, 

Greetings from Syncfusion Support. 

In the demo sample of search event, we have used search method in Query. In getEvents of scheduler we will get all the appointments available in scheduler and on every key up of search by all event fields textbox, we will search from the appointments of scheduler and the search results are shown in data grid in the showSearchEvents method. 

document.getElementById('events-search').onkeyup = (args: KeyboardEvent) => { 
        let searchString: string = (args.target as HTMLInputElement).value; 
        if (searchString !== '') { 
            new DataManager(scheduleObj.getEvents(null, null, true)).executeQuery(new Query(). 
                search(searchString, ['Subject', 'Location', 'Description'], null, true, true)).then((e: ReturnOption) => { 
                    if ((<Object[]>e.result).length > 0) { 
                        showSearchEvents('show', e.result); 
                    } else { 
                        showSearchEvents('hide'); 
                    } 
                }); 
        } else { 
            showSearchEvents('hide'); 
        } 
    }; 

Also we have individual field search and the search results are shown in the data grid. Please refer to the source code once and let us know if you need any further assistance on this.  

Regards, 
Nevitha 


Marked as answer

MC Maikel Cordeiro April 6, 2021 12:58 PM UTC

Thanks.

Do you have the same example using Javascript Vanilla?


HB Hareesh Balasubramanian Syncfusion Team April 8, 2021 10:32 AM UTC

Hi Maikel, 

Thanks for the update. 

We have prepared a sample based on your shared query “need the same sample in JS Vanilla” in the JavaScript Vanilla platform, which can be downloaded from the following link. 


Kindly try the above solution and get back to us if you need any further assistance. 

We will be happy to assist you..! 

Regards, 
Hareesh 



MC Maikel Cordeiro April 8, 2021 02:18 PM UTC

Awesome!!

I'll implement it in my code.

It's exactly what I need.

Thank you so much. 

MC


NR Nevitha Ravi Syncfusion Team April 9, 2021 06:05 AM UTC

Hi Maikel, 

You are most welcome..! please get back to us if you need any further assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon