Page 1 of 2

Master & child records in one frame

Posted: Tue Sep 02, 2014 5:57 pm
by Raj7069635

Hi,
This is regarding the master detail records. I have products collection, it has product name and other attributes. say I have product p1, p1 would be offered in different colors and each color is priced differently. i.e say p1 has three child records, p1blue - $1, p1black-$2, p1pnk- $3. Child records live in productItems collection with custom foreign key with products. Now in the screen I would like to display product name and couple other attributes and I wanna display a check box for related product items to pick one. Is there way to achieve this other than custom java script?..Thanks in advance


Master & child records in one frame

Posted: Tue Sep 02, 2014 6:21 pm
by Evgene Karachevtsev

Hello Raj,

It depends on your project, maybe you can use just mapping, but most likely you will need the custom js. I think it will be easier.


Master & child records in one frame

Posted: Wed Sep 03, 2014 5:14 am
by Raj7069635

Hi, I implemented above child relationship as an array in parent collection. so I have quick question. please check the below picks. In the array, weight field is the driving factor. As you can see in the below pic, I have implemented weight as a select menu. I want to display the rest of the field values based on weight selection. what options do I have?. Thank you

Image

Image


Master & child records in one frame

Posted: Wed Sep 03, 2014 2:39 pm
by Evgene Karachevtsev

Raj,

You can map the child elements of the object-answer only to child UI components. For example, if you have a grid, and you map the array to it, then the child elements of the array can be mapped to the components located in this grid.


Master & child records in one frame

Posted: Wed Sep 03, 2014 5:19 pm
by Raj7069635

That's what I did..but I get below result. am I missing some thing here. Please advise. Thank you Image Image


Master & child records in one frame

Posted: Wed Sep 03, 2014 5:34 pm
by Raj7069635

I mean after the select Menu, next two label's data is not getting displayed(populated). Ideally what I want is, weight data to be displayed in select menu. and next two label's populate the data from selected records. below is my array object.

{"array":[{"weight":"17.63 oz.","price":"7.49","onpromo":"N","promoprice":"","promostart":"","promoend":""},{"weight":"35.63 oz.","price":"9.99","onpromo":"N","promoprice":"","promostart":"","promoend":""}]} Image


Master & child records in one frame

Posted: Thu Sep 04, 2014 1:39 am
by Yurii Orishchuk

Hi Ray,

I'm have some confusing about what you want to implement. Could please provide us result screen shot what you want to get and describe it?

Also if you need to:
1 populate with "details" array select.
2 populate with "details" array some other list.

You need to have this two components(select and other list) in the same hierarhical level.

See details about it on screen shot: http://prntscr.com/4jgwqi/direct

So in this case you need to get out your select component from grid component.

Regards.


Master & child records in one frame

Posted: Thu Sep 04, 2014 3:51 am
by Raj7069635

Hi Yurii,

I have a product collection with all prod attributes as shown in the below. Each product is available in different sizes and each size is priced. So I have created product weight & price in an array

Image

below is the Response from the service

Image

in my UI screen , I wanna display product name, image, desc, menu select to display all available sizes; display the price based on size selection

Image

Hope I explained it well. Below is app mapping

Image

I get below result; No data is displayed in price label

Image


Master & child records in one frame

Posted: Thu Sep 04, 2014 3:53 am
by Raj7069635

one additional thing; this product screen is product list view


Master & child records in one frame

Posted: Thu Sep 04, 2014 4:33 am
by Yurii Orishchuk

Ok, this time it's clear.

I've tested it and need to say - unfortunatly it's a bug.

I've reported it to our developers team.

We will update you here when will have any information about.

Regards.