Page 1 of 1

Filtering an iteration

Posted: Mon Jun 15, 2015 10:32 pm
by sdanigo

When I map an array of data on the screen, in the screen side of the mapping, can I put a javascript test saying :

'if in the left side of the mapping, someValue == someTest then skip that iteration and go to the next one' ?

Thanks

Sylvain


Filtering an iteration

Posted: Tue Jun 16, 2015 6:12 am
by Alena Prykhodko

Hello Sylvain,

Should be possible. Please take a look here https://devcenter.appery.io/documenta...


Filtering an iteration

Posted: Wed Jul 01, 2015 3:59 am
by Henry

I have a model with 6 members. I have a made an array of objects using this model. How do I refer to a specific Member using the custom JS on the mapping page?


Filtering an iteration

Posted: Wed Jul 01, 2015 8:19 am
by Dongzhi Yang7528784

Hi Sylvain,

That is an interesting question.
There are a couple of ways you can do it.

  1. filter away the record(iteration) that you don't want in the server side. Use a 'query' service instead of 'list' service Or create your own server code that only return the records(iterations) you want.

  2. hide the records(iterations) after mapping. Add a javascript after "success: Mapping" on your page service. in that javascript, iterate the interface control that displays your records and hide those with values you don't want.

    Hope this helps

    Dongzhi


Filtering an iteration

Posted: Wed Jul 01, 2015 11:31 pm
by Henry

2. hide the records(iterations) after mapping. Add a javascript after "success: Mapping" on your page service. in that javascript, iterate the interface control that displays your records and hide those with values you don't want.

Hi Dongzhi. Any helpful resources on how to accomplish this?


Filtering an iteration

Posted: Thu Jul 02, 2015 1:41 am
by Henry

2. hide the records(iterations) after mapping. Add a javascript after "success: Mapping" on your page service. in that javascript, iterate the interface control that displays your records and hide those with values you don't want.

Hi Dongzhi. Any helpful resources on how to accomplish this?


Filtering an iteration

Posted: Thu Jul 02, 2015 3:04 am
by Dongzhi Yang7528784

Hi Henry,
If you already have an array, you may use $.each() function from jquery to iterate each member. the following link about jquery selectors and the $.each() function should help.
http://www.w3schools.com/jquery/jquer...
http://www.w3schools.com/jquery/misc_...

Regards

Dongzhi