Page 1 of 3

How to access Appery component properties with javascript?

Posted: Thu Jan 02, 2014 3:05 am
by bahar.wadia

I am trying to change the color and background transparent property of a mobilegridcell_123, using javascript.

How can I do this?

Also, is there a document that I can refer to reference for all the properties for the Appery components and how to access them.

Thank you in advance.


How to access Appery component properties with javascript?

Posted: Thu Jan 02, 2014 3:20 am
by Igor

Could you show us your JS code which you are using to change the color and background transparent properties ?

You can use JQuery API to get component properties. Please take a look at this doc http://docs.appery.io/javascript-api/


How to access Appery component properties with javascript?

Posted: Thu Jan 02, 2014 4:02 am
by bahar.wadia

I'd share the the javascript, but I don't even know where to start. I did take a look at the link, but it's not comprehensive.

To create my example, start by placing a grid. Then during runtime change the color andbackground transparent property using JavaScript.


How to access Appery component properties with javascript?

Posted: Thu Jan 02, 2014 5:05 am
by maxkatz

Most components in Appery.io are just the standard jQuery Mobile components. To access any element in the DOM, you can use jQuery or use the Appery(..) function (which is a wrapper to jQuery select): http://docs.appery.io/javascript-api/.

Once you have a reference to the component, you can use any API available on that component (jQuery, jQuery Mobile).


How to access Appery component properties with javascript?

Posted: Fri Jan 03, 2014 3:44 am
by bahar.wadia

I look for a jQuery grid/table component, but did not find either. So can you please help me with how I can change the transparent background property of your grid component using javascript.

Thanks


How to access Appery component properties with javascript?

Posted: Fri Jan 03, 2014 4:33 pm
by maxkatz

The Grid component is just a table for now. You are right, it doesn't have API. Use jQuery to select the grid (table) or any rows and then change its background color.


How to access Appery component properties with javascript?

Posted: Fri Jan 03, 2014 4:39 pm
by Kateryna Grynko

You can use this CSS, for example:preAppery("grid").css("opacity", value);
/preWhere 'grid' is a name of Grid component,
'value' is a value from 0 to 1 (1 is not transparent).


How to access Appery component properties with javascript?

Posted: Sat Jan 04, 2014 8:36 pm
by bahar.wadia

This does not work.


How to access Appery component properties with javascript?

Posted: Mon Jan 06, 2014 10:06 am
by Kateryna Grynko

Hi Bahar,

Did you change source code? What opacity value did you use? Could you please post this code?


How to access Appery component properties with javascript?

Posted: Mon Jan 06, 2014 4:49 pm
by bahar.wadia

For color...

document.getElementById(ElementID).style.backgroundColor="#ff0000";

For transparent...
document.getElementById("MyElementID").style.backgroundColor="transparent";

It would be nice if all this could be accessed by Appery("....").

Hope this helps.