Tuesday 15 July 2014

Add id VerticalLayout SapUi5 -



Add id VerticalLayout SapUi5 -

i'm trying add together id each div of vertical layout. can javascript without.

code generate vertial layout:

var otext1 = new sap.ui.commons.textfield({value:"edward"}); var otext2 = new sap.ui.commons.textfield({value:"maria"}); var olayoutver = new sap.ui.layout.verticallayout("layoutver", { content: [otext1, otext2] });

this gen:

<div id="layoutver" data-sap-ui="layoutver" class="sapuivlt sapuivlt"> <div class="sapuivltcell sapuivltcell"><input id="__field1" ... value="edward"></div> <div class="sapuivltcell sapuivltcell"><input id="__field2" ... value="maria"></div> </div>

i find it: http://scn.sap.com/thread/3386749, without onafterrendering, give thanks you

i guess trying style elements or query javascript. can create utilize of nth-child selector without need additional id:

css

#layoutver:nth-child(2) { width: 100%; }

jquery

var secondchild = $(#layoutver:nth-child(2)); var allchildren = $(#layoutver).children();

generally speaking there need utilize of ids css perspective. since utilize css selectors query elements , have various other possibilities traverse dom jquery need ids here, too. real utilize ui5 controls via sap.ui.getcore().byid(). divs trying access no ui5 controls though - elements vertical layouts html output.

the point is: can't see reason have ids on divs :)

br chris

sapui5

No comments:

Post a Comment