search events from database

i want to search event from database by passing event name or id how to achieve that

any suggestion ?

1 Like

dhtmlxConnector provides an API for filtering. You can pass search values with the request parameters and use them as arguments for for filters
docs.dhtmlx.com/doku.php?id=dhtm … filtration

i want no event to be loaded when scheduler.html loads, events should be shown only when user search for events based on id or name

can u provide any working example ?

The events are loaded by explicit call of scheduler.load function. If you don’t call this method, events won’t be loaded

When it’s needed you can remove previously loaded events and call loading, passing search parameters with the request

scheduler.clearAll(); scheduler.load("url?name=" + nameString); //or scheduler.load("url?id=" + id);
On the server side you can attach filter as described in the article from my previous post. Something like following[code]$scheduler = new schedulerConnector($res, $dbtype);

function custom_filter($filter_by){
if (isset($_GET[ā€˜name’]))
$filter_by->add(ā€œname_columnā€,$_GET[ā€˜name’],ā€œLIKEā€);
else if(if (isset($_GET[ā€˜id’]))
$filter_by->add(ā€œid_columnā€,$_GET[ā€˜id’],"=");
}

$scheduler->event->attach(ā€œbeforeFilterā€,ā€œcustom_filterā€);
…[/code]

thanks…i solved problem in different way

I’ve been asked to create a simple search dialog box.
(I’ll put a button above the calendar)

Seems like this would be a popular option.

It looks like filters and the above example might work.

But I’m coming up a bit short with ideas.

Can anyone point me to an example like I’m describing?

TIA,

David