Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eventCopyPasteAction: clone not working when resourceIds field is configured on EventModel #9027

Closed
ghulamghousdev opened this issue Apr 19, 2024 · 0 comments
Assignees
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@ghulamghousdev
Copy link
Member

Forum post

Steps:

  1. Use the below code in scheduler basic example
import '../_shared/shared.js'; // not required, our example styling etc.
import Scheduler from '../../lib/Scheduler/view/Scheduler.js';
import EventModel from '../../lib/Scheduler/model/EventModel.js';
class CustomEventModel extends EventModel {
    static $name = 'CustomEventModel';
    static fields = [
        { name : 'resourceIds', persist : true }
    ];
}
//region Data

const
    resources = [
        { id : 'r1', name : 'Mike' },
        { id : 'r2', name : 'Linda' },
        { id : 'r3', name : 'Don' },
        { id : 'r4', name : 'Karen' },
        { id : 'r5', name : 'Doug' },
        { id : 'r6', name : 'Peter' },
        { id : 'r7', name : 'Sam' },
        { id : 'r8', name : 'Melissa' },
        { id : 'r9', name : 'John' },
        { id : 'r10', name : 'Ellen' }
    ],
    events = [
        { id : 1, name : 'Foo', startDate : new Date(2017, 0, 1, 6), resourceIds : ['r1', 'r2'], duration : 24, durationUnit : 'h' }
    ];
//endregion

const scheduler = new Scheduler({
    appendTo   : 'container',
    eventStore : {
        modelClass : CustomEventModel,
        data       : events
    },
    resourceStore : {
        data : resources
    },

    features : {
        eventCopyPaste : { copyPasteAction : 'clone' }
    },
    startDate        : new Date(2017, 0, 1, 6),
    endDate          : new Date(2017, 0, 1, 20),
    viewPreset       : 'hourAndDay',
    rowHeight        : 50,
    barMargin        : 5,
    multiEventSelect : true,
    columns          : [
        { text : 'Name', field : 'name', width : 130 }
    ]
});
  1. Copy an event and paste to another resource
  2. See the event is assigned to another resource instead of clone
Screen.Recording.2024-04-19.at.3.39.25.PM.mov
@ghulamghousdev ghulamghousdev added bug Something isn't working forum Issues from forum large-account Reported by large customer labels Apr 19, 2024
@ghulamghousdev ghulamghousdev self-assigned this Apr 21, 2024
@ghulamghousdev ghulamghousdev added in progress ready for review Issue is fixed, the pull request is being reviewed and removed in progress labels Apr 22, 2024
@isglass isglass added resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Apr 23, 2024
@isglass isglass added this to the 5.6.10 milestone Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

2 participants