Page 1 of 1

After API request, empty grid displayed when turning from invisible to visible

Posted: Wed Nov 27, 2013 4:44 pm
by anelezeravla

Hello,
We have a REST service that returns a list of elements. Each of these elements is formed by a string and an image. That API REST is called upon load on a page. That page, therefore has a grid that contains a label and an image, so that each element returned by the API is mapped to the grid, the string is mapped to the label and the image is mapped to the image. The grid is at first invisible, and becomes visible when the REST service call is a success.

The thing is that every time, the first grid displayed is empty (with the default image). The elements of the list are correctly displayed below, each one in its grid, but the first one is always empty.

This problem disappears if the grid is always visible. If we don't do the not visible-visible change when API call is successful, then no empty grid appears.

Any hints on what the problem might be?

Thank you very much


After API request, empty grid displayed when turning from invisible to visible

Posted: Wed Nov 27, 2013 5:08 pm
by Oleg Danchenkov

Hi. What code do you use to change element's visibility?


After API request, empty grid displayed when turning from invisible to visible

Posted: Wed Nov 27, 2013 5:12 pm
by anelezeravla

It's the set property action. We have created an event that set property of the grid to visible=true when the API request is sucess.


After API request, empty grid displayed when turning from invisible to visible

Posted: Wed Nov 27, 2013 7:21 pm
by Maryna Brodina

Hello! Looks like a bug. Instead set property action on service success event use pre$("[name=mobilegridName]").not("[_tmpl=true]").show();/premobilegridName - name of Grid you use for mapping.


After API request, empty grid displayed when turning from invisible to visible

Posted: Thu Nov 28, 2013 9:20 am
by anelezeravla

It works perfect now.
Thank you very much, Maryna. Your answers are always of great help.