Passing data from UI controller to Javasript it loses some data

I am returning my data from my UI controller and I have two objects of the same type in the data which are a certain entity. You can see they both contain values and if you were to fully expand either they are assigned the correct values.

UI Controller

Now If you look in the javascript it loses all the values on the second entity of the same type. I am showing one of the data objects in the console

JS image

I am just wondering if anyone knows whats going on and if it is possible to pass a data object with Json that contains two entities of the same type per data objects.

Thanks!

Add Comment
1 Answer(s)

This javascript fixed my issue as it now makes the reference values look at the actual values. I know the 4 is hard coded but there are only every 4 elements in the return set and they always have the same values on them except one column so hard coded value of 4 is acceptable in this case.

options.data.forEach(function (element) {             if (element.FromCurrency.$ref == 4 && element.ToCurrency.$ref == 4) {                 element.FromCurrency = options.data.find(x => x.ToCurrency.$id = '4').ToCurrency;                 element.ToCurrency = options.data.find(x => x.ToCurrency.$id = '4').ToCurrency;             }             else if (element.ToCurrency.$ref == 4) {                 element.ToCurrency = options.data.find(x => x.ToCurrency.$id = '4').ToCurrency;             }         }); 
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.