Hello team!
Please introduce the 'type' on your DataField and all its children.
If you look at the docs of StringDataField you can see it recommends to create a new Model and pass an array of field configs specifying the "type". So this config should be public.
class Person extends Model {
static get fields() {
return [
{ name : 'name', type : 'string' }
];
}
}
When I extend the Model class and specify the fields, I get the following error:
Object literal may only specify known properties, and 'type' does not exist in type 'Partial<DataFieldConfig>'.
Class definition:
import { Model, DataFieldConfig } from '@bryntum/schedulerpro'
class GroupModel extends Model {
static get $name(): string {
return 'GroupModel'
}
static get fields(): Partial<DataFieldConfig>[] {
return [
{ name: 'title', type: 'string' },
{ name: 'players', type: 'array' },
{ name: 'teamId', type: 'int', dataSource: 'team_id' },
]
}
}
export default GroupModel
If we look at the schedulerpro-5.1.1/build/schedulerpro.d.ts file and search for DataFieldConfig, we don't see "type" in the list of fields.
type DataFieldConfig = {
alwaysWrite: boolean
column: string|object
compare: Function
dataSource: string
defaultValue: any
internal: boolean
label: string
name: string
nullText: string
nullValue: any
nullable: boolean
persist: boolean
readOnly: boolean
}
Please improve the docs and typings.
Cheers!