juricin
Posts: 0
Joined: Tue Jan 13, 2015 5:09 am

Change label within grid cell on click

Hi Illya, response below. Thanks, Ante

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

Change label within grid cell on click

Hello,

Please try to debug http://devcenter.appery.io/documentat...
Are there any error in console?

juricin
Posts: 0
Joined: Tue Jan 13, 2015 5:09 am

Change label within grid cell on click

Hi Alena, there is no error in console

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

Change label within grid cell on click

1) Ihor suggested global variable flag_checked, that can be used to set a state of your components - visible or not
2) Open console
3) Click the component

juricin
Posts: 0
Joined: Tue Jan 13, 2015 5:09 am

Change label within grid cell on click

Hi Alena, yes did all that. When I click the component nothing shows in the console, its simply blank.

If i just use:

Apperyio("good_count_label").hide();
Apperyio("good_amount_label").show();
Apperyio("textGood").hide();
Apperyio("textRaised").show();

This works on single click of the component.

but as soon as I add:

var flag_checked;
if (flag_checked){
Apperyio("good_count_label").hide();
Apperyio("good_amount_label").show();
Apperyio("textGood").hide();
Apperyio("textRaised").show();
flag_checked = true;
}else{
Apperyio("good_count_label").show();
Apperyio("good_amount_label").hide();
Apperyio("textGood").show();
Apperyio("textRaised").hide();
flag_checked = false;
}

Then the click component no longer works and no error shows in the console :(

Thanks for help, Ante.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Change label within grid cell on click

Yes, this is correct, behavior, because you still haven't placed flag_checked to the global scope.
This variable will always have only false value, therefore only one part will work.

You want to toggle your elements am I right?
Add a toggle component and on value change add this code with one change - instead of flag_checked set toggle value check, on or off.

juricin
Posts: 0
Joined: Tue Jan 13, 2015 5:09 am

Change label within grid cell on click

thanks :)

Return to “Issues”