Skip to content

Scheduler - Antipattern at "onRemove" and "onAdd" events, throws Binding to event property 'onAdd' is disallowed for security reasons, please use (Add) #1164

Open
@luiscla27

Description

@luiscla27

Feature request

Package versions you currently use:

devexteme version: 20.2.6
devextreme-angular version: 20.2.6

Description:
Currently onRemove and onAdd are not events, they are input parameters of Function type, this is consider as a bad practice in Angular as you can easily lose control of this references. The current implementation looks like this:

<dx-scheduler ... >
    <dxi-view ... </dxi-view>
    <dxo-appointment-dragging [group]="draggingGroupName" [onRemove]="onRemove" [onAdd]="onAdd">
    </dxo-appointment-dragging>
</dx-scheduler>

Preferred Solution:
The expected implementation for <dxo-appointment-dragging> would look like this:

<dxo-appointment-dragging [group]="draggingGroupName" (onRemove)="onRemove($event)" (onAdd)="onAdd($event)"> 
</dxo-appointment-dragging>

Alternatives:
Currently I'm stickin with your Function "events", the following is the demo where I found this issue:
https://js.devexpress.com/Demos/WidgetsGallery/Demo/Scheduler/CustomDragAndDrop/Angular/Light/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions