Checking value in combo.

Hi All,

I want to search a value is present in combo or not.

Example: - 10, 20, 30 and 40 are present in a combo.
I want to check value 60 is present in the combo or not.

Thanks,
Abhi

Hi,

you may use getOption method:

if(combo.getOption(60)){
alert(“exists”)
}

Hi Alexandra,

Thanks for quick response.

what is ‘combo’ here.

I have 3 to 4 combo in a grid.
i want to check the value in 3rd combo,
then what i will do in this case?

Thanks,
Abhi

Hi,

what is ‘combo’ here.

combo is the dhtmlXCombo instance.

i want to check the value in 3rd combo

grid.attachEvent("onEditCell",function(stage,rId,cIndex){ if(stage==2&&index == 2){ var value = grid.cells(rId,cIndex).getValue(); if(!combo.getOption(value )) return false; } return true })

Hi,
i want to do this before inserting a new row.
i tried but i received a js error.
‘combo’ is undefined.
Thanks,
Abhi

To get combo object you may use getColumnCombo method:

var combo = grid.getColumnCombo(2);
if(!combo.getOption(value )){

}

Hi Alexandra,

Now it is working fine.
getColumnCombo(value) is for ‘combo’ coltypes.
what is the similar type of methods for ‘coro’ coltypes.

Thanks,
Abhi

Hi,

you may use getCombo method for coro. However, getOption method is dhtmlxCombo (combo excell) method and can not be used for coro or co object. There is not a public method to check the value of the “coro” combo. Therefore, you need to check the values that you put to the combo using own methods.