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

Multi-select and drag drop not working when using assignment store #197

Closed
matsbryntse opened this issue Jan 15, 2020 · 3 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@matsbryntse
Copy link
Member

matsbryntse commented Jan 15, 2020

Progress made on branch "multieventdrag". Needs test coverage.

https://www.bryntum.com/forum/viewtopic.php?p=68339#p68339

Replace drag selection app.js with


/* eslint-disable no-unused-vars */
import '../_shared/shared.js'; // not required, our example styling etc.
import Scheduler from '../../lib/Scheduler/view/Scheduler.js';
import '../../lib/Scheduler/feature/EventDragSelect.js';
import '../../lib/Core/widget/Checkbox.js';
import WidgetHelper from '../../lib/Core/helper/WidgetHelper.js';

//region Data

const [countLabel, unifiedDragCheckbox] = WidgetHelper.append([
    {
        type: 'widget',
        ref: 'countLabel',
        html: '0 events selected'
    }, {
        type: 'checkbox',
        label: 'Unified drag',
        onChange({ checked }) {
            scheduler.features.eventDrag.unifiedDrag = checked;
        }
    }
], { insertFirst: document.getElementById('tools') || document.body });

let 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' }
    ],
    assignments = [{
        eventId: 'e1',
        resourceId: 'r1',
    }, {
        eventId: 'e2',
        resourceId: 'r2',
    }, {
        eventId: 'e3',
        resourceId: 'r3',
    }],
    events = [
        {
            id: 'e1',
            resourceId: 'r1',
            startDate: new Date(2017, 0, 1, 10),
            endDate: new Date(2017, 0, 1, 12),
            name: 'Click me',
            iconCls: 'b-fa b-fa-mouse-pointer'
        },
        {
            id: 'e2',
            resourceId: 'r2',
            startDate: new Date(2017, 0, 1, 12),
            endDate: new Date(2017, 0, 1, 13, 30),
            name: 'Drag me',
            iconCls: 'b-fa b-fa-arrows'
        },
        {
            id: 'e3',
            resourceId: 'r3',
            startDate: new Date(2017, 0, 1, 14),
            endDate: new Date(2017, 0, 1, 16),
            name: 'Double click me',
            eventColor: 'purple',
            iconCls: 'b-fa b-fa-mouse-pointer'
        },
    ];

//endregion

let scheduler = new Scheduler({
    adopt: 'container',
    minHeight: '20em',
    resources: resources,
    events: events,
    assignments: assignments,
    startDate: new Date(2017, 0, 1, 6),
    endDate: new Date(2017, 0, 1, 20),
    viewPreset: 'hourAndDay',
    multiEventSelect: true,

    features: {
        eventDragSelect: true,
        eventDragCreate: false
    },

    columns: [
        { text: 'Name', field: 'name', width: 130 }
    ],

    listeners: {
        eventselectionchange({ selection }) {
            console.log(selection);
            const count = scheduler.selectedEvents.length;

            countLabel.html = `${count} event${count === 1 ? '' : 's'} selected`;
        }
    }
});

Need to update updateRecordsMultipleAssignmentMode to handle drop on new resource.

@matsbryntse matsbryntse added the bug Something isn't working label Jan 15, 2020
@matsbryntse matsbryntse added this to the Scheduler 3.0.2 milestone Jan 15, 2020
@matsbryntse matsbryntse modified the milestones: Scheduler 3.0.2, Scheduler 3.0.3 Jan 29, 2020
@seanchambo
Copy link

Any updates on this @matsbryntse? Is it being actively worked on yet?

@matsbryntse
Copy link
Member Author

The issue is resolved for our master branch and fix will come in the next major release, ETA 6w

@matsbryntse matsbryntse modified the milestones: Scheduler 3.0.3, 4.0 Feb 12, 2020
@matsbryntse
Copy link
Member Author

Resolved in 4.0

@SergeyMaltsev SergeyMaltsev added this to the 4.0.0 milestone Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants