We are refactoring our gantt app, and in the process I managed to break the implementation of our custom editor controls for the grid view, and I just can't figure out what I did wrong. Could you please take a look at the sample attached?
We don't intend to use the React wrapper going forward. Do you have some documentation on how to incorporate custom controls using the pure JS Gantt component ?
You can do custom editors with the pure JS Gantt, so for a non-wrapper app, you must either:
Implement your editor as a Bryntum Widget (or subclass) that implements the editor contract (getValue, setValue, isValid, focus) and supply that as the column.editor; or
Create a regular Widget whose html contains a container div and mount your React component into that div yourself (ReactDOM.createRoot(...) on widget render and unmount on widget destroy). This gives you React inside the pure JS Gantt but you must handle lifecycle/value APIs yourself.
See the Column editor docs for the editor contract and examples: Column.editor and the Widget class for building custom widgets: Widget.
I'm implementing it by extending the Widget class. I have uncovered some issues - could you take a look ?
1) Widget doesn't work when returning DomConfig - nothing is rendered.
2) Returning DOM works - but text remains invisible unless color is defined (inherits color:transparent)
3) Hot reload results in the following error - why not just ignore multiple calls to initClass() ?
Error: Type "coreflowganttcontrol" already registered with _Widget2 factory
I checked here and confirmed that you need to extend a Field instead of Widget class, as I mentioned earlier. Sorry for misleading you with that information. You can see that on this documentation.
Using
export class CoreFlowGanttControl extends Field {
makes all render as expected, and I don't see the hot reload error as well.
It didn't quite work. Extending Field instead of Widget caused a compiler error because isValid is not a function but a property, according to the TypeScript type defs. So I assigned it an initial value of true. Oh boy - had I only known this would cause me to lose two days of producitivity
Bryntum-2025-09-11-000.png (108.31 KiB) Viewed 2609 times
It turns out the actual type is not a property as seen in the TypeScript definition, but a getter, as we can see in the source code. And the value assignment above makes the edit control fail silently in our gantt app - it never showed up when double clicking the cell.
Bryntum-2025-09-11-001.png (1.06 MiB) Viewed 2609 times
Attempting to define isValid as a getter will break the build.
Bryntum-2025-09-11-002.png (90.72 KiB) Viewed 2609 times
I suppose we could suppress the error, which defeats the purpose of using TS.
If you agree that there is a bug in the type def, could you please address it ?
Also, you guys provided us with managedCellEditing to give us more control over our custom editing controls. Is that only supported with React controls, or will it also work with controls extending from Field ?
{
text : 'Start',
type : 'date',
field : 'start',
width : '11em',
editor : (ref : any) => <DateEditor ref={ref} />,
managedCellEditing : false
}
EDIT: Initial tests indicates that managedCellEditing does not work for controls extending Field. I will try to create a runnable sample to prove this and file it as a potential bug report in another ticket/post.
EDIT 2: I got it working in the Basic sample project - you can ignore the questions about managedCellEditing for now.