View Poll Results: Should this functionality be implemented?

Voters
1. You may not vote on this poll
  • TOTALLY

    1 100.00%
  • NOPE

    0 0%
Results 1 to 4 of 4

Thread: How to disable an option in Ext.field.Select?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    13
    Vote Rating
    1
      0  

    Default Answered: How to disable an option in Ext.field.Select?

    Hi there,

    I have the following construct to create a select:

    Code:
    Ext.create('Ext.field.Select',
    {
        renderTo: Ext.get("displaySizes"),
        xtype: 'selectfield',
        label: item.label,
        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:

    HTML Code:
    <select>
      <option value="1235" disabled="disabled">36</option>
      <option value="1234">40</option>
    </select>
    Anyone able to help me out?

    Thx

  2. You would need to add some select listeners to the list or slots with order before and return false. You would also have to style an option that is disabled.

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    You would need to add some select listeners to the list or slots with order before and return false. You would also have to style an option that is disabled.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default Set property....

    Hidden:True

  5. #4
    Sencha User
    Join Date
    Jul 2012
    Posts
    13
    Vote Rating
    1
      0  

    Default

    Quote Originally Posted by usman.afzal View Post
    Hidden:True
    Was that a question? There is no such property. And if there was, than it would hide the item and not show, but disable it. I still want the user to see the disabled values.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •