Skip to content

How to create a Viewlet

Andrey Platov edited this page Sep 6, 2021 · 3 revisions

Viewlet описывается объектом класса view.class.Viewlet. Например, чтобы объекты recruit.class.Candidate показывались в таблице, нужно добавить соответствующее описание в модель:

  builder.createDoc(view.class.Viewlet, core.space.Model, {
    attachTo: recruit.class.Candidate,
    descriptor: view.viewlet.Table,
    open: recruit.component.EditCandidate,
    // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
    options: {
      lookup: {
        resume: chunter.class.Attachment
      }
    } as FindOptions<Doc>, // TODO: fix
    config: ['', 'city', '$lookup.resume', 'channels']
  })
Clone this wiki locally