ssossossosso

Forums

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

This topic contains 8 replies, has 3 voices, and was last updated by Artem Liubeznyi Artem Liubeznyi 11 months, 2 weeks ago.

  • Creator
    Topic
  • #23016

    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
  • #23019
    Mike Kudelya
    Mike Kudelya
    Oro Core

    Hi

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

    #23020

    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

    #23023
    Mike Kudelya
    Mike Kudelya
    Oro Core

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

    #23032

    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.

    #23040

    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!

    #23066
    Mike Kudelya
    Mike Kudelya
    Oro Core

    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.

    #23080

    bosumflici
    Participant

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

    #24696
    Artem Liubeznyi
    Artem Liubeznyi
    Oro Core

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