Page 1 of 1

CSS in mapped response

Posted: Sun Apr 20, 2014 9:21 pm
by anon

In the response mapping of a service, I am trying to add logic to format my element.

in function(value, element){
$(element).css('text-align', 'right');
}

how would I target the element in a css call?

In particular, I am trying to change the location of a label component contained inside the element


CSS in mapped response

Posted: Sun Apr 20, 2014 9:57 pm
by Illya Stepanov

Hi Benjamin -

You can use browser tools to inspect target elements: http://docs.appery.io/documentation/d...


CSS in mapped response

Posted: Sun Apr 20, 2014 9:58 pm
by anon

Yes, but this doesn't quite answer my question as the element that comes through is from an array list. So I can't statically target an 'id'. My question is regarding syntax of such.


CSS in mapped response

Posted: Mon Apr 21, 2014 12:19 pm
by Kateryna Grynko

Hi Benjamin,

You can use Appery function to access the component:preAppery('componentname').css('text-align', 'right');/pre
Same as above, just without using Appery function (straight jQuery):
pre$('div[dsid="componentname"]').css('text-align', 'right');/preorpre$("[dsid=componentname]").css('text-align', 'right'); /preWhere componentname is a name of the component.