Show/Hide event ?

Heelo,
I am trying to find a way to hide events fro displaying in the scheduler even if the data is really here.
I would like to use this functionnality to remove some events without deleting them so I would just have to show them again if the user want to see this data (and by the way I avoid to call back the server for data that has already been loaded)

Is it possible ? I didn’t find anything in the doc…

Thanks in advance

You can define some method, like

scheduler.filter_month = function(ev){ if (ev.hidden) return false; return true; }; scheduler.filter_day = scheduler.filter_week = scheduler.filter_month;

Ok I will try with these events.
Are there the same events for the timeline or the units view ?

for each view you can define

scheduler.filter_{view_name}

which will be used to filter events in target view ( for timeline it will be filter_timeline )

Hiya,

I am trying to filter events on the fly (after loading the scheduler). inputObj is a text box and I want to filter (show/hide) the events by matching the textbox value with event name.

inputObj.onkeyup = function (e){
     scheduler.filter_timeline=function(id, event){
           if(event.name.toLowerCase().indexOf(inputObj.value.toLowerCase()) != -1){
                 return true;
            }
            return false;
      };
}

Any pointer or idea, what am I missing?

Thanks,

Hello,

event.name.toLowerCase().

event.text is default property, are you sure it’s not a mistype?

Best regards,
Ilya

I guess the problem is with the filtering (its not being fired up). I am not sure if I need to include some extra .js/.css files.

To make it simple, I tried to use filtering in one of the examples (06_timeline/06_week_timelines.html) provided with DhtmlxScheduler. To test filter functionality, I only added the following piece of code just after scheduler.parse(…) method:

scheduler.filter_timeline=function(id, event){
      return false; //hides the event, right?
};

The output remains the same (showing all the events). According to my understanding, it should not any event … right? (correct me please if I am wrong).

See the sample file attached.

Thanks,
06_week_lines.html.zip (2.04 KB)

Just to add to my previous post:

Day, Week and Month views seem to be working fine (filtering the events properly) if I add the following file:

scheduler.filter_day=scheduler.filter_week=scheduler.filter_month=scheduler.filter_timeline;

But ‘timeline’ view is showing events all the time.

typo: if I add the following line:

Hello,

You don’t need to include additional js files, this is a core functionality.
I just checked locally using scheduler\samples\06_timeline\02_lines.html sample, added

scheduler.filter_timeline = function(id, event){ return false; }
And no events there displayed.
Note that ‘timeline’ here should match name of the view here:

scheduler.createTimelineView({ name: "timeline",
Best regards,
Ilya

This is interesting :slight_smile:
I just also added the same code in my local file: scheduler/samples/06_timeline/02_lines.html
But the page shows all the events …
This could be because of using differenct versions of scheduler:
I am using the latest scheduler → [url]http://dhtmlx.com/docs/products/dhtmlxScheduler/download/dhtmlxScheduler.zip[/url]
What do you reckon?
02_lines.rar (1.49 KB)

Can you please send me your package of scheduler.

Hello,

Thank you, indeed it doesn’t work in the original package. I’ve attached updated version of timeline and treetimeline extension and will update Known issues page shortly.

Kind regards,
Ilya
dhtmlxscheduler_timeline.zip (5.84 KB)

Thanks Ilya,

It is working now after replacing the old js files with new one (you provided) and calling

scheduler.render_view_data();

Great!