i just started using this tool and I find it very useful, powerful and flexible (Amazing job DHTMLX Team!).
Anyway, I have a question regarding creating a custom filter to retrieve certain events from the database.
How can I write a custom filter query for custom fields in the table so that I can see the events that I want.
For example:
I add a new field in the event table called ‘status’. The status field contains either ‘bad’ or ‘good’ value. Then I create a custom selectbox called ‘status’ in the html page (on top of the calendar box). When user select the status, it will update the calendar automatically with the new query.
Here is the code for the selectbox:
[code]
Good
Bad
[/code]
Can anyone guide me or point me to the right direction? I have gone through each of the post in this forum and found nothing for this kind of topic.
It works like a charm, thank you very much!
Another question,
Is it possible to refresh the event page without reloading?
So, let’s say the user change the status filter from ‘bad’ to ‘good’,
Can we put a function on the onchange event on the selectbox?
Something like this:
scheduler.filter_month = scheduler.filter_week = function(ev_id, event){
if(event.CreatedById ==userId)
{
return true; // event will be rendered
}else{
return false; // event will be filtered (not rendered)
}
}
javascript code for auto update calendar:
var int=self.setInterval("updateCalendar()",3000);
function updateCalendar()
{
status = document.getElementById("status").value;
scheduler.load('01_basic_init_connector.php?uid='+scheduler.uid());
}
Let me know if you guys encounter any issues, I would love to help and contribute to this great tool as well!