Results 1 to 3 of 3

Thread: Disabling an Option in a Combobox

  1. #1
    Sencha User
    Join Date
    Nov 2016
    Posts
    8

    Default Disabling an Option in a Combobox

    Hi,

    I am not very sure what is the best approach to show an Option as disabled in a Combobox
    Will setting a dynamic displayTpl work?
    if so, appreciate your help for an illustration with an example

    I am trying to display an option in 'disabled' style based on a condition at runtime

    so far,: I got
    myStore = task_type_combo_box.getStore(); myStore.each(function (r) {
    // Disable the Data Item
    if(r.data.v_out_event_type == eOption) {
    r.data.v_out_event_desc = "Disabled - " + r.data.v_out_event_desc;
    }
    });
    task_type_combo_box.bindStore(myStore);

    I am able to show it with a prefix 'Disabled'

    I would like to apply a disabled style instead of a prefix

    Appreciate your help

    Thanks
    Raj

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

  3. #3
    Sencha User
    Join Date
    Nov 2016
    Posts
    8

    Default

    Hi Gary,
    Thanks for your reply

    I tried

    Code:
        myStore = task_type_combo_box.getStore();
        myStore.each(function (r) {
            // Disable the Data Item
            if(r.data.v_out_event_type == eOption) {
                theValue = r.data.v_out_event_desc;
                task_type_combo_box.displayTpl = Ext.create('Ext.XTemplate',
                   '<tpl>', '<div class="x-boundlist-item" style="color:grey | important ;"> {theValue} </div>', '</tpl>'
                );
            }
        });
        task_type_combo_box.bindStore(myStore);
    
    and it shows
    
    <div class="x-boundlist-item" style="color:grey | important ;">  </div>

    Thanks
    Raj

Similar Threads

  1. Disabling cursor in non-editable combobox?
    By noodles in forum Ext: Discussion
    Replies: 1
    Last Post: 10 Apr 2013, 7:46 AM
  2. Replies: 10
    Last Post: 28 Mar 2013, 2:35 AM
  3. Disabling the Ajax HTTP-option
    By elkalb in forum Sencha Touch 2.x: Discussion
    Replies: 2
    Last Post: 3 Jun 2012, 11:50 PM
  4. disabling combobox based on the value of other column
    By Komal Vaswani in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 7 Apr 2011, 5:11 AM
  5. How to reload Combobox with <option></option> ?
    By saucompeng in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 10 Feb 2011, 1:12 AM

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
  •