Hi,
Can you please give some example how to implement dropdown list column in React? Example I have column Status, then each row should have custom list items that I can select to update the particular row.
Thanks
Hi Tasnim,
If I'm going to convert the following code for React Typescript, what should be the data type of editorContext? It's giving me "Binding element 'editorContext' implicitly has an 'any' type.ts(7031)" error.
startCellEdit : ({ editorContext }) => {
const { record, editor, column } = editorContext;
if (column.field === 'condition' && record.isLeaf) {
// Load possible employees to assign to this particular task
editor.widgetMap['b-combo-2'].items = ['To do', 'Doing', 'Done', 'Test'];
} else {
editor.widgetMap['b-combo-2'].items = ['warm', 'cold', 'normal'];
}
}
Thanks
Hi,
For now, you could use any
type for that
We have a ticket to improve our type definitions here https://github.com/bryntum/support/issues/5176
Hi,
You could adjust the picker width using this https://bryntum.com/products/gantt/docs/api/Core/widget/Combo#config-pickerWidth
editor.widgetMap['b-combo-2'].pickerWidth = 200;
For the items, can it support an array of object?
current code
editor.widgetMap['b-combo-2'].items = ['To do', 'Doing', 'Done']
sample below. then on edit, the value that should be passed as payload on sync is the id.
editor.widgetMap['b-combo-2'].items = [{id:1 , text: 'To do'},{id: 2, text: 'Doing'},{id: 3, text: 'Done'}]
Hi,
You could use this https://bryntum.com/products/grid/docs/api/Core/widget/Combo#config-valueField
set it to 'id'
{
text : 'Condition',
field : 'condition',
editor : {
type : 'combo',
valueField : 'id'
}
}