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
8920
json data source
posted

Have very simple setting : 

<body>
<div id="auditSetCombo"></div>
<script type="text/javascript">
var uoaAuditSetUpController = function () {
function bindAuditSetCombo() {
var auditsDDwn = JSON.parse('[{"AuditId":0,"AuditName":"unassigned"},{"AuditId":1,"AuditName":"Audit_32513_1"},{"AuditId":2,"AuditName":"Audit_32513_2"},{"AuditId":3,"AuditName":"Audit_32513_3"}]');
$('#auditSetCombo').igCombo('option', 'dataSourceType', 'json');
$('#auditSetCombo').igCombo('option', 'dataSource', auditsDDwn);
$('#auditSetCombo').igCombo('dataBind');
}

return {
bindAuditSetCombo: bindAuditSetCombo
};
}();
$(function () {
$("#auditSetCombo").igCombo({
valueKey: "AuditId",
textKey: "AuditName"
});
uoaAuditSetUpController.bindAuditSetCombo();
});
</script>

</body>

when run getting the following error : 

Uncaught Error: There was an error parsing the JSON data and applying the defined data schema: Cannot read property 'Metadata' of null  infragistics.core.js:228

I am on 14.1 and if I would remove $('#auditSetCombo').igCombo('option', 'dataSourceType', 'json');  it would work fine... why it is not accepting 'json' type.. it works in similar circumstances in other places..