Our state of the art Gantt chart


Post by lanpeng »

Hi bryntum team,
As the title, i want to set the option in the combo dropdown box to disabled.

	{
                            text: 'Status',
                            field: 'currentStatus',
                            filterable: false,
                            editor : {
                                type       : 'combo',
                                editable   : false,
                                autoExpand : true,
                                items      : [
                                    {
                                        value:'To Do',
                                        text:'To Do',
                                        readOnly:true,
                                    },
                                    {
                                        value:'Doing',
                                        text:'Doing',
                                        readOnly:false,
                                    },
                                    {
                                        value:'Transferred',
                                        text:'Transferred',
                                        readOnly:false,
                                    }
                                ],
                                listeners:{
                                   
}, }, width: 100, }

The above section of my code does not take effect . Can you provide me with some help?

Attachments
MicrosoftTeams-image (8).png
MicrosoftTeams-image (8).png (183.25 KiB) Viewed 103 times

Post by tasnim »

Hi,

Can you please share a bit more detail about your use case that what should be disabled when you select a specific combo item?


Post by Animal »

A readOnly field will not make a record unselectable. It's not being mutated

In 6.0 there will be an isSelectable callback config in List which allows apps to decide whether a list item is allowed to be selected, so the code would be

editor : {
    ...,
    picker : {
        isSelectable(record) {
            // Your code returns true or false
        }
    }
}
Screenshot 2024-02-29 at 08.04.55.png
Screenshot 2024-02-29 at 08.04.55.png (64.38 KiB) Viewed 72 times

Post by Animal »

You can use a listener handler now:

editor : {
    picker : {
        onBeforeItem({ record }) {
            // return false to veto the action
        }
    }
}

https://bryntum.com/products/scheduler/docs/api/Core/widget/List#event-beforeItem


Post Reply