Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Select item from igCombo by Value

I'm loading JSON data into an igCombo via the dataSource property. I've set the valueKey of the igCombo to a property of the JSON data. I would like to select an item from the igCombo by the value of the property set by the valueKey.


var jsonData = [
{textValue: "this is dummy data", importantId: 1 },
{textValue: "this is also dummy data", importantId: 2 }
width: "270px",
dataSource: jsonData,
textKey: "textValue",
valueKey: "importantId"
//Now I need to add code that would select the second item
//("{textValue: "this is also dummy data", importantId: 2}")
//from the igCombo.
//The API suggests that the "select" method
//should be used.
//Neither of these lines work as expected.

$("#checkboxSelectCombo1").igCombo("select", jsonData[1]);
$("#checkboxSelectCombo1").igCombo("select", {importantId: 2});
$("#checkboxSelectCombo1").igCombo("select", 2);


No Data
  • 25
    Verified Answer

    I found the answer after some trial and error. The "value" method ( is the one that should be used.

    $("#checkboxSelectCombo1").igCombo("value", 2);