OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – How do I? Questions OroCalendar and Filters

This topic contains 8 replies, has 3 voices, and was last updated by  Artem Liubeznyi 5 years, 8 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #36324

    bosumflici
    Participant

    Hi,

    I want to use filters like ones used with datagrid but with orocalendar. Can you give me some hints for starting?

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • #36325

    Mike Kudelya
    Participant

    Hi

    Are we talking about /calendar/default page ?
    What properties of calendar do they must filter ?

    #36326

    bosumflici
    Participant

    Hi

    It’s not about the oro default calendar events. I’ve created my custom event entity and it has some properties which i need to filter. For example if we refer to orocalendar events i need to filter events by description containing some “text”!

    Thanks

    #36327

    Mike Kudelya
    Participant

    As i understood are you need to create datagrid for your custom entity ?

    #36328

    bosumflici
    Participant

    No! I have developed my own calendar bundle with my custom evenst entity. The calendar view is working good. What i need now is to add some filters for the calendar view to filter the events. I was thinking to use the filters that shows with a datagrid in a index template, but instead of filtering datagrid collection, they must filter the calenndar events collection.

    #36329

    bosumflici
    Participant

    To understand better i added a print screen: screen capture

    Looking at this picture, i need to be able to filter calendar events when i change a filter from the grid filters.

    Thanks!

    #36330

    Mike Kudelya
    Participant

    Hi,

    I understood what you want.

    Replace _onFilterUpdated function of filters manager following code:

    Further call following code from here:

    and add this new function to calendar-view.js:

    add this code to calendar view page:

    How it works. When filter is changed filter manager call current_active_filters trigger with all active filters, further calendar view calls api and get all calendar events, after that calendar events array go to setCalendarCollection event and update collection. Also you should modify api get function to filter your calendar event. This is good base to start, for now change month arrows don’t work, i think better save your active filters inside calendar-view.js and call api from these and somehow handle buttons with this filters.

    #36331

    bosumflici
    Participant

    Thank you Mike! Indeed is a good base to start. Your code works like charm!

    #36332

    Artem Liubeznyi
    Spectator

    @bosumflici

    Out of sheer product curiosity: Why would you develop a custom calendar bundle? To me it looks like a tool for project management, a Gantt chart template. What were your use cases?

Viewing 8 replies - 1 through 8 (of 8 total)

The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.

Back to top

You will be redirected to [title]. Would you like to continue?

Yes No

You will be redirected to [title]. Would you like to continue?

Yes No