I have the following construct to create a select:

Ext.create('Ext.field.Select',
{
    renderTo: Ext.get("displaySizes"),
    xtype: 'selectfield',
    label: 'Sizes',
    options: [
        {
            disabled: true //<- does not work
            text: "36"
            value: "1235"
        },
        {
            disabled: false
            text: "40"
            value: "1234"
        }


    ]
}

where I want to disable some options to show the user that they are there, but are not selectable.

Just as it would work using html:

<select>
  <option value="1235" disabled="disabled">36</option>
  <option value="1234">40</option>
</select>

Anyone able to help me out?

Thx

有帮助吗?

解决方案

I tried it by myself but i guess there is no easy way to do this becuse "disable" is not a property of the option and there is no built in way to do this.

It is possible to disable the field in total but the option itself is no component and has no more options than value and text.

You would have to edit the pickers used for a selectlist. And there is more than one (Tablet Picker, PhonePicker, ...)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top