I am trying to perform jQuery each function on something like:
\"RelatedDoc\": [
{
\"Id\": \"test\",
\"Number\": \"26262316\"
}
],
option 1 (this uses the key
as the option 'id' i.e. 1, 2, 3 etc):
$.each($('#panel_MRD').data('obj'), function (key,value) {
$('select.mrdDisplayBox').addOption(key, value.Id + ' - ' + value.Number, false);
});
have not tested, so potentially rushed answer.
[edit] - had a quick look back at this as i realised that there are potentially 2 values that you could use as the option 'id', either key or value.Number.
option 2 (this uses value.Number
as the option 'id' i.e. 26262316):
$.each($('#panel_MRD').data('obj'), function (key,value) {
$('select.mrdDisplayBox').addOption(value.Number, value.Id + ' - ' + value.Number, false);
});
will stop thinking now... :-)