# Upgrade guide for Scheduler v3.1.0

## Context menu

### Base class

`TimeSpanRecordContextMenuBase` class was deprecated. Common functionality was moved to `ContextMenuBase` class, and
functionality related to `TimeAxis` was moved to `TimeSpanMenuBase` class.

### HeaderContextMenu feature for TimeAxis

`HeaderContextMenu` feature was replaced by `TimeAxisHeaderMenu`. `TimeAxisHeaderMenu` extends HeaderMenu to provide
TimeAxis specific header menu items. `extraItems` config was turned into `items` which is a named object:

**Old code:**

```javascript
const scheduler = new Scheduler({
    features : {
        headerContextMenu : {
            extraItems : [
                {
                    text : 'Extra',
                    onItem() { ... }
                }
            ],

            processItems({ items }) {
                items.push({
                    text : 'Cool action',
                    onItem() { ... }
                }
            }
        }
    }
});
```

**New code:**

```javascript
const scheduler = new Scheduler({
    features : {
        timeAxisHeaderMenu : {
            items : {
                myExtraItem : {
                    text : 'Extra',
                    onItem() { ... }
                }
            },

            processItems({ items }) {
                items.coolItem = {
                    text : 'Cool action',
                    onItem() { ... }
                }
            }
        }
    }
});
```

### Disable menu for locked grid

To disable header/cell context menu for locked grid, but leave it for normal grid please follow this way:

**Old code:**

```javascript
const scheduler = new Scheduler({
    features : {
        contextMenu : {
            processHeaderItems : ({ column }) => column instanceof TimeAxisColumn,
            processCellItems   : () => false
        }
    }
});
```

**New code:**

```javascript
const scheduler = new Scheduler({
    features : {
        headerMenu : false // it doesn't turn off context menu for time axis column header now
        cellMenu   : false
    }
});
```

### There is no "Context" in naming

We got rid of `Context` in `EventContextMenu` and `ScheduleContextMenu` features to follow the same naming standards 
in all products. So now they are called EventMenu and `ScheduleMenu` correspondingly.

### Context menu events

Some of Scheduler's events provided by `EventContextMenu` and `ScheduleContextMenu` features were replaced by 
`EventMenu` and `ScheduleMenu` features correspondingly. 

Here is the list of changes:

- `eventContextMenuBeforeShow` -> `eventMenuBeforeShow`;
- `eventContextMenuShow` -> `eventMenuShow`;
- `eventContextMenuItem` -> `eventMenuItem`;
- `scheduleContextMenuBeforeShow` -> `scheduleMenuBeforeShow`;
- `scheduleContextMenuShow` -> `scheduleMenuShow`;
- `scheduleContextMenuItem` -> `scheduleMenuItem`;

For example:

**Old code:**

```javascript
const scheduler = new Scheduler({
    listeners : {
        eventContextMenuBeforeShow : () => {...}
        eventContextMenuShow : () => {...}
        eventContextMenuItem : () => {...}
        scheduleContextMenuBeforeShow : () => {...}
        scheduleContextMenuShow : () => {...}
        scheduleContextMenuItem : () => {...}
    }
});
```

**New code:**

```javascript
const scheduler = new Scheduler({
    listeners : {
        eventMenuBeforeShow : () => {...}
        eventMenuShow : () => {...}
        eventMenuItem : () => {...}
        scheduleMenuBeforeShow : () => {...}
        scheduleMenuShow : () => {...}
        scheduleMenuItem : () => {...}
    }
});
```


<p class="last-modified">Last modified on 2023-10-26 8:19:20</p>