Page 2 of 2

Change label within grid cell on click

Posted: Sun Jan 18, 2015 5:16 am
by juricin

Hi Illya, response below. Thanks, Ante


Change label within grid cell on click

Posted: Tue Jan 20, 2015 10:41 am
by Alena Prykhodko

Hello,

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


Change label within grid cell on click

Posted: Tue Jan 20, 2015 11:27 am
by juricin

Hi Alena, there is no error in console


Change label within grid cell on click

Posted: Tue Jan 20, 2015 12:58 pm
by Alena Prykhodko

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


Change label within grid cell on click

Posted: Tue Jan 20, 2015 11:28 pm
by juricin

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.


Change label within grid cell on click

Posted: Thu Jan 22, 2015 12:29 pm
by Illya Stepanov

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.


Change label within grid cell on click

Posted: Sat Jan 24, 2015 5:50 am
by juricin

thanks :)