Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Iterate mapping over a grid, 3 per row ( or more)

Hi LuisMa,

To write code here you need:

1 Wrap code with "<pre" tag.
2 Replace all < chars with <

Test tab does not affect with generic security context.
You need to reinit your service response with actual JSON .

So:
1 use this code to log, and copy actual JSON from console:
pre

console&#46;log(JSON&#46;stringify(response))

/pre

2 Open service "Test" tab.
2.1 Paste JSON to "response" area.
2.2 Click on "Import as response".

Details:
http://prntscr.com/4vyccm/direct

After your response parameters will change to actual response from JSON. And you will be able to use these parameters in mapping.

Regards.

LuisMa Suárez Gutiérrez
Posts: 0
Joined: Mon Aug 18, 2014 9:12 pm

Iterate mapping over a grid, 3 per row ( or more)

ok done.
now, the mapping.
this doesnt work, i get a " Uncaught Error: Attempt to access Object by index: i http://gyazo.com/724231f4a2670c8e702e... "
http://gyazo.com/957a16b178cce2db3015...

same this http://gyazo.com/25376aefb728b6a08c9e...
nope : http://gyazo.com/de90e605785a73281e8a...

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Iterate mapping over a grid, 3 per row ( or more)

Hi LuisMa,

Please use following code instead of yours to get newvalue:

pre

newvalue = {firstObject: value[j], secondObject: value[j+1], thirdValue: value[j+2]};

/pre

Then reinit your response parameters.

And you will get response with three objects inside available at the same time.

Regards.

LuisMa Suárez Gutiérrez
Posts: 0
Joined: Mon Aug 18, 2014 9:12 pm

Iterate mapping over a grid, 3 per row ( or more)

Yes. I thought of that toó. Beautiful mapping.
Didnt work. Says that there is no "name" in undefined. :(.

LuisMa Suárez Gutiérrez
Posts: 0
Joined: Mon Aug 18, 2014 9:12 pm

Iterate mapping over a grid, 3 per row ( or more)

Hi, I couldnt upload images because i was going to bed.

the mapping:
http://gyazo.com/51b3581cc4bb22a36399...
http://gyazo.com/c4348074c288f9b3bffa...

Yes, I got all three items available at the same time and it iterates the grid.
but the labels dont update. it just stays blank. i don see any errors on console though.

the results on page: http://gyazo.com/0a3c6c2ed6122f42e4b6...

the logged object: http://gyazo.com/182629888de014b41ced...

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Iterate mapping over a grid, 3 per row ( or more)

Hi LuisMa,

Mapping looks good :)

Please give us your app public and describe steps to reproduce this problem.(how we can invoke this service).

Regards.

LuisMa Suárez Gutiérrez
Posts: 0
Joined: Mon Aug 18, 2014 9:12 pm

Iterate mapping over a grid, 3 per row ( or more)

http://appery.io/app/view/976cc6ce-c0...
the usr is :1
password is : 1

1:You choose "villa Guerrero" from selectmenu (its the first option),
2:click on "mas informacion"

this is my page in the app builder: http://gyazo.com/26afa69c806b99a46eee...

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Iterate mapping over a grid, 3 per row ( or more)

Hi LuisMa,

I've checked your app and here is why you have this problem:

http://prntscr.com/4waehh/direct

So you should replace code:

pre

oldSuccess&#46;call(this,value, other);

/pre

With:

pre

oldSuccess&#46;call(this, newresponse, other);

/pre

That's all :)

Regards.

Return to “Issues”