ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

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 Artem Liubeznyi 1 year, 2 months ago.

  • Creator
    Topic
  • #62730

    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
  • #62731
    Mike Kudelya
    Mike Kudelya
    Moderator

    Hi

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


    #62732

    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

    #62733
    Mike Kudelya
    Mike Kudelya
    Moderator

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


    #62734

    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.

    #62735

    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!

    #62736
    Mike Kudelya
    Mike Kudelya
    Moderator

    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.


    #62737

    bosumflici
    Participant

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

    #62738
    Artem Liubeznyi
    Artem Liubeznyi
    Keymaster

    @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)

You must be logged in to reply to this topic.

ssossossosso