[CLOSED] Uncheck an item in Multiselect combobox

  1. #1

    [CLOSED] Uncheck an item in Multiselect combobox

    I have a scenario where i select all the items from the combobox on the "select all" button. But for some condition i need to uncheck one particular item from the multi select combobox .Here's what i have implemented so far:

     if (text == "select") {
                App.CmbCountries.selectAll();
                var item = App.CmbCountries.getStore().findRecord("COUNTRY_CD", -2)            
                var rec = App.CmbCountries.getSelectedRecords();
    
                Ext.each(rec, function (item1) {
                    if (item1.data.COUNTRY_CD == item.data.COUNTRY_CD) {
                        item1.set('checked', false);
                    }
                });
    
                lnk.hide();
                deslect.show();
            }
    But it is not working. what is missing
    Last edited by Daniil; Apr 03, 2014 at 4:10 AM. Reason: [CLOSED]
  2. #2
    Hi @PriceRightHTML5team,

    To deselect an item, please use a MultiCombo's deselectItem method.
    var rec = App.ComboBox1.getStore().getAt(0);
    
    App.ComboBox1.deselectItem(rec);
    However, currently there is a bug. We are investigating a possible fix.
  3. #3
    Fixed in SVN trunk. Please update.
  4. #4
    Quote Originally Posted by Daniil View Post
    Fixed in SVN trunk. Please update.
    Thanks its working
  5. #5
    Hi,
    I am using the same function

    App.Combobox1.deselectItem(rec)
    on another screen. But is causing error while page load.
    If I remove this respective line page loads / works fine.
  6. #6
    There might be an error if a ComboBox is not rendered yet.

    Could you, please, clarify why you deselect an item on page load? How do you select item? It might be better not to select an item if you don't need it selected.

Similar Threads

  1. MultiSelect with Checkbox in each item
    By shaileshsakaria in forum 2.x Help
    Replies: 2
    Last Post: Aug 03, 2013, 11:06 AM
  2. Replies: 0
    Last Post: Oct 12, 2012, 10:45 AM
  3. Replies: 4
    Last Post: May 09, 2012, 9:24 PM
  4. Replies: 0
    Last Post: Mar 09, 2010, 7:28 AM
  5. Replies: 0
    Last Post: Apr 15, 2009, 7:49 AM

Tags for this Thread

Posting Permissions