How to access Appery component properties with javascript?

This forum contains topics that were moved from Get Satisfaction
bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

How to access Appery component properties with javascript?

Post 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.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

How to access Appery component properties with javascript?

Post 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/

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

How to access Appery component properties with javascript?

Post 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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to access Appery component properties with javascript?

Post 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).

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

How to access Appery component properties with javascript?

Post 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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to access Appery component properties with javascript?

Post 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.

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

How to access Appery component properties with javascript?

Post 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).

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

How to access Appery component properties with javascript?

Post by bahar.wadia »

This does not work.

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

How to access Appery component properties with javascript?

Post by Kateryna Grynko »

Hi Bahar,

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

bahar.wadia
Posts: 0
Joined: Wed Aug 07, 2013 2:05 am

How to access Appery component properties with javascript?

Post 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.

Post Reply