sdanigo
Posts: 0
Joined: Sat Jun 06, 2015 8:50 pm

Filtering an iteration

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

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Filtering an iteration

Hello Sylvain,

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

Henry
Posts: 0
Joined: Wed Jul 01, 2015 3:59 am

Filtering an iteration

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?

Dongzhi Yang7528784
Posts: 0
Joined: Mon May 11, 2015 6:28 am

Filtering an iteration

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

Henry
Posts: 0
Joined: Wed Jul 01, 2015 3:59 am

Filtering an iteration

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?

Henry
Posts: 0
Joined: Wed Jul 01, 2015 3:59 am

Filtering an iteration

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?

Dongzhi Yang7528784
Posts: 0
Joined: Mon May 11, 2015 6:28 am

Filtering an iteration

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

Return to “Issues”