2 Replies Latest reply on May 28, 2015 2:57 PM by randyFuse

    Dynamically created symbols stacking vertically

    randyFuse

      Greetings I've run into a rather strange problem and it has me stump

       

      I'm dynamically creating symbols from  the library and and when I test they new elements are being stack vertically and my code is rather simple. I even tried  placing the newly created symbols  in different containers and on the stage with the same result. What's even more strange it wasn't doing this before. Here's what I'm doing

       

      for( var i = 0; i < products.length; i++){

           var sI = sym.getSymbol('s3_timeline').createChildSymbol("s3_year_indicator", "s3_timeline_ruler");

           var ind = sI.getSymbolElement()

      }

       

      What gives? Any ideas? Thanks

        • 1. Re: Dynamically created symbols stacking vertically
          joel_pau Level 5

          Hi,

           

          Here are 2 cases: horizontal and vertical.

           

          1) Horizontal alignment:

          for( var i = 0; i < products.length; i++) {

              var sI = sym.getSymbol('s3_timeline').createChildSymbol("s3_year_indicator", "s3_timeline_ruler");

              sI.getSymbolElement().css( { "position": "relative", "display": "inline-block"} );

          }

           

          2) Vertical alignment:

          for( var i = 0; i < products.length; i++) {

              var sI = sym.getSymbol('s3_timeline').createChildSymbol("s3_year_indicator", "s3_timeline_ruler");

              sI.getSymbolElement().css("position", "relative");

          }

           

          Findings: so, you have to check css properties.

          I am using v5.0.1.

          • 2. Re: Dynamically created symbols stacking vertically
            randyFuse Level 1

            Ty that fixed it. I'm still figuring out how it was working before but now it's changing its css:position property at run time.

             

            Thanks again.