User945338570 posted
hi, I have following JSON string but unable to bind it :
JSON string :
var result ="{\"GroupDispositions\":[{\"Code\":\"C\",\"Description\":\"CONTACTED\"},{\"Code\":\"NC\",\"Description\":\"NOT CONTACTED\"}],\"Response\":[{\"ResultCode\":\"0\",\"ResultString\":\"Pass\"}]}";
Here is my Code:
function OnSuccess_FillDispositions(result) {
try {
if (result == null)
return;
var items = result.d || result;
var combo = $find('<%=cmbMainDisposition.ClientID %>');
var combosubsub = $find("<%= cmbSubSubDisposition.ClientID %>");
// alert(combo);
if (combo != null) {
combo.clearItems();
combosubsub.clearItems();
combosubsub.clearSelection();
for (var rowIndex = 0; rowIndex < result.length; rowIndex++) {
var row = result[rowIndex];
var comboItem = new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_value(row.Code);
comboItem.set_text(row.Description);
comboItem.get_attributes().setAttribute("Code", row.Code);
combo.get_items().add(comboItem);
}
}
combo.get_items().getItem(0).select();
}
Please help!