I have customized the StatusColumn column, which is of the dropdown type. By default, it has four options: 'To Do', 'Doing', 'Done', 'Cancelled'. My question is how to manually modify these default options
import { Column, ColumnStore } from '@bryntum/gantt';
/**
* @module StatusColumn
*/
/**
* A column showing the status of a task
*
* @extends Gantt/column/Column
* @classType statuscolumn
*/
export default class StatusColumn extends Column {
static get $name() {
return 'StatusColumn';
}
static get type() {
return 'statuscolumn';
}
static get isGanttColumn() {
return true;
}
static get defaults() {
return {
// Set your default instance config properties here
field : 'status',
text : 'Status',
editor : {
type : 'dropdown',
items : ['To Do', 'Doing', 'Done', 'Cancelled']
},
cellCls : 'b-status-column-cell',
htmlEncode : false,
};
}
//endregion
renderer({ record,isExport}) {
const status = record.status;
// console.log(record)
if(isExport){
return status
}else{
return status ? {
// tag : 'i',
className : `${status}`,
html : status
} : '';
}
}
}
ColumnStore.registerColumnType(StatusColumn);
Re: [ANGULAR] Manually modify dropdown items
Posted: Fri Jan 13, 2023 4:13 pm
by marcio
Hey shimnx,
What do you mean by
manually modify these default options
??
If you change this part
items : ['To Do', 'Doing', 'Done', 'Cancelled']
It'll change the options, so if you put something like
After I double click it doesn't show text, it still shows the id, and I want it to always show the text corresponding to the id. And the text is empty when I select it
If you've already defined the status field into TaskModel. And still, you're facing this issue
Then, Could you please upload your app here so we can reproduce and debug it?