bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
54 stars 6 forks source link

Should be possible to set scheduler partner as a component selector #1979

Open pmiklashevych opened 3 years ago

pmiklashevych commented 3 years ago

https://www.bryntum.com/docs/gantt/#Scheduler/view/Scheduler#config-partner should accept string to be considered as a global selector. If nothing found just ignore the partner config.

The selector should support ID, ref, custom property.

We do similar in the framework wrappers, for example: SchedulerPro/examples/frameworks/npm/angular/projects/schedulerpro/src/lib/schedulerpro.component.ts

    // The application may have passed string id of the partner so
    // we attempt to find the real instance of the scheduler with that id
    if (config['partner'] && 'string' === typeof config['partner']) {
      const bryntum = window['bryntum'],
        partner = bryntum && bryntum.get && bryntum.get(config['partner']);
      config['partner'] = partner || undefined; // undefined is not supported yet, see #1978
    }

We could replace it in all framework wrappers after all

Related to: https://www.bryntum.com/forum/viewtopic.php?p=79797#p79797

isglass commented 3 years ago

Might already be possible, config system allows up.xxx to resolve configs. Its bound early though, so mileage may vary.

items : {
  gantt : {
    type : 'gantt'
  },
  scheduler : {
    type : 'scheduler',
    partner : 'up.gantt'
  }
}