Brian6028327
Posts: 0
Joined: Tue Jul 09, 2013 1:21 pm

Clear a grid?

I'd like to clear out a grid first so that when I populate it, I can be sure only new information is showing.

I'm trying the following:

var dropDown = Appery("grid_Name");
dropDown.empty();

But this seems to be nuking the whole grid. I would like to keep its structure, etc, and just make it ready to accept new data. Should I try something better?

-thanks

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

Clear a grid?

Hi, Brian.
Try to clear content of the elements.
For example, clear all labels in a grid with name gridName:
Appery("gridName").find("[data-role=appery_label]").text("");

Brian6028327
Posts: 0
Joined: Tue Jul 09, 2013 1:21 pm

Clear a grid?

Hmmm... I haven't gotten it to work yet. I replaced the gridName with the actual one in my app. I tried a few replacements regarding

data-role=appery_label

and also copying and pasting as-is, but no luck. Am I missing something?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Clear a grid?

Hi Brian,

What components are used inside the grid?

Brian6028327
Posts: 0
Joined: Tue Jul 09, 2013 1:21 pm

Clear a grid?

It is a grid with 3 columns:
A small thumbnail picture element
Description label
ID # label

I just need to clear it out when a menu item is selected, so it can be re-populated with current data, which may have more or fewer rows.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Clear a grid?

Brian,

If you use service for filling page then it refills the grid itself.

Was anything cleaned with the sample code above? Are there any errors in console (F12) ?

Brian6028327
Posts: 0
Joined: Tue Jul 09, 2013 1:21 pm

Clear a grid?

Ah ok, I'll just try repopulating it from the REST call. Currently, one of my calls has data and one does not, and that's good, because we want to test for that condition. But with no data I expected the grid to clear out when the service is called and that is not happening - the data from the previous call stays there.

No errors are being thrown, but I must be missing something...

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Clear a grid?

Hello! Please share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a

Brian6028327
Posts: 0
Joined: Tue Jul 09, 2013 1:21 pm

Clear a grid?

Thanks, I'll make a 1 page sample app, so you don't have to navigate 5 screens in with user and password prompts along the way...

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Clear a grid?

Hi Brian,

Please tell us the shared app name. Let us know if there are any problems.

Return to “Issues”