PDA

View Full Version : [CLOSED] Uncheck an item in Multiselect combobox



PriceRightHTML5team
Aug 07, 2013, 7:00 AM
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

Daniil
Aug 07, 2013, 8:28 AM
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.

Daniil
Aug 07, 2013, 8:51 AM
Fixed in SVN trunk. Please update.

PriceRightHTML5team
Aug 07, 2013, 10:30 AM
Fixed in SVN trunk. Please update.

Thanks its working

PriceRightHTML5team
Mar 27, 2014, 2:16 PM
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.

Daniil
Mar 28, 2014, 12:23 AM
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.