Our pure JavaScript Scheduler component


Post by oleh »

When some teams consist of only one resource, sorting by teams does not work as expected and produces artifacts sometimes - see the video

Attachments
Screencast 2022-06-30 16-46-57.mp4
(112.87 KiB) Downloaded 32 times

Post by marcio »

Hey oleh,

Could you please share the configuration that you're using in that video? A sample data would be nice too to reproduce here.

Best regards,
Márcio


Post by oleh »

Resources look like

    resources: [
      {
        id: 1,
        name: 'Tom',
        team: 'A-Team'
      },
      {
        id: 2,
        name: 'Jerry',
        team: 'A-Team'
      },
      {
        id: 3,
        name: 'Peter Pan',
      },
      {
        id: 4,
        name: 'James Bond',
        team: 'MI6'
      },
      {
        id: 5,
        name: 'Michael Jordan',
        team: 'Chicago Bulls'
      },
      {
        id: 6,
        name: 'Scotty Pippen',
        team: 'Chicago Bulls'
      },
      {
        id: 7,
        name: 'Stephen Curry',
        team: 'Golden State Warriors'
      }
    ],

And config is like this:

    features: {
      mergeCells: { disabled: false }
    },
    columns: [
      {
        text: 'Team',
        field: 'team',
        mergeCells: true,
        mergedRenderer: teamColumnRenderer,
        renderer: teamColumnRenderer
      },
      {
        text: 'Name',
        field: 'name'
      }
    ]
teamColumnRenderer = (context: ColumnRendererContext) => {
  const team = context.record.team;
  return team ?? '';
};

Before that I create a store

        this.scheduler.resourceStore = new ResourceStore({
          fields: SchedulerResourceModel.fields,
          sorters: [
            { field: 'team', ascending: true },
            { field: 'name', ascending: true }
          ]
        });

Post by marcio »

Hey,

After debugging, I believe the issue that you're having is because of that missing team property that you have in the Peter Pan record after I added an empty team: "" in that register, all worked just fine.

Best regards,
Márcio


Post by oleh »

Thanks for your effort, but it still doesn't work for me, I did what you said and later even rearranged the resources in two teams, and it still doesn't work. Maybe the problem is in some other parts of code, which unfortunately I cannot share right now. I need to prepare a reproducible example.


Post by marcio »

Hey Oleh,

Thanks, a reproducible example would be great to help you with that issue.

Best regards,
Márcio


Post Reply