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
1170
Select combo by value
posted

Any idea why this is not working 

<div id="combo"></div>
<button onclick = SetValue>SetByValue</button>

<script>
$(function () {

var data = [
{ "ID":1, "Name": "John Smith", "Age": 45 },
{ "ID":2, "Name": "Mary Johnson", "Age": 32 },
{ "ID":3, "Name": "Bob Ferguson", "Age": 27 }
];

$("#combo").igCombo({
dataSource: data, //JSON Array defined above
valueKey: "ID",
textKey: "Name",
itemTemplate: "<div>${ID} - ${Name}</div>"
});
});

function SetValue(){
var item = $("#combo").igCombo("itemByValue", "2");
$("#combo").igCombo("selectedIndex", item.index);

}
</script>

I want to select combo based on  value. According to this post it should work http://www.infragistics.com/community/forums/p/68712/347998.aspx

-Manish

Parents
No Data
Reply Children
No Data