Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

checkbox, mappable array

Hi,
I wonder if anyone can help with this
I have a checkboxgroup populated by a service query

What my target is to allow the user choose some checkboxes save both text and vale to array,
and map the array result to the 2 labels in the grid, 1 for checkbox text and the other for value.

as I dont know haw many items a user may choose, I need to map to a grid with the 2 labels.

Here are screenshots of UI in builder and in browser.
Hope I have explained well enough

Please note the collapsibles are hard coded and dont rely on a service,
only the checkboxgroup are populated by a service

Thanks

Image

Image

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

checkbox, mappable array

Hello Michael,
1) create new LSV at Model&Storage
2) add js code on click event
3) find with jquery or 'this' variable value and label of current component
4) save all to LSV
5) now you can you your LSV to map it elsewhere

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

checkbox, mappable array

Hi Egor,
Thank you!
I have my Model&Storage and the LSV is available in mapping, here are the screenshots.
Is there an example of the js required?
I tried a few variations but am getting errors in builder, this is my attempt

code$grid = $(this).closest("[name=topgrid1]");
save({'Topping':$('input[name=mobilecheckboxgroup1]:checked').closest("div").find("label").text().trim();
'Price':$('input[name=mobilecheckboxgroup1]:checked').closest("div").find("value").val().trim();
"toppingslist");/code

Thanks!

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

checkbox, mappable array

Hello Michael,

Is there an example of the js required?
Unfortunately, no, cause it depends on your page structure and LSV

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

checkbox, mappable array

Hi Egor,
LSV is as above, model is available in mapping.
as regards page structure
components are in collapsable content area
collapsable is in a grid and is hard coded
service populates checkgroup in collapsable content area,
when radio button is selected
as above see screenshots

thanks

Return to “Issues”