search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

search on v.events.list?

Asked by Ed
1 day ago.

Hi,

Would like to do a live search on my web forms project without having to go back and forth to the database, etc. In looking at the page source of my monthly calendar, I see a line labeled “v.events.list” which has all of the data that I’m looking to search through. Are there any native capabilities to perform a search on this dataset? Lacking that, does anyone have any techniques for getting this data? I’ve tried a couple of JavaScript code samples (from Google) for getting the data from the page source but so far, no real success.

Thanks in advance - Ed

Answer posted by Dan Letecky [DayPilot]
13 hours ago.

Yes, this is possible using the events.find() method. You can also access the events.list array directly.

In ASP.NET WebForms, you need the client-side object to access the API.

<DayPilot:DayPilotMonth ... ClientObjectName="month" ... />

Find events:

const event = month.events.find(1);

or

const events = months.events.find(e => e.data.text.includes("important"));
Comment posted by Ed
9 hours ago.

Hi Dan, ok thanks for that - so the “e.data.text” value in the above code snippet is the same as the “events.list” array? I’m assuming that I would need to loop through the array and do other things (show/hide, etc.) - would it be something along the lines of:

let searchQuery = document.getElementById("searchbox").value.toLowerCase(); //search field on the page

const events = months.events.find(e => e.data.text.includes(searchQuery));

for (let i = 0; i < events.length; i++) {

if (events.includes(searchQuery)) {

…do something…

} else {

…do something else…

}

…etc.

Thanks - Ed

Comment posted by Ed
1 hour ago.

OK, disregard my previous - found an example on how to access the events.list array and I can currently output to console records based on my search field entry. Now just need to figure out how to show/hide based on the searched values.

New Reply
This reply is
Attachments:
or drop files here
Your name (optional):