Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    RowSpacerItem

    Hi,

    I have a DynamicForm defined with titleOrientation : 'top' ... Is there a
    way to have a RowSpacerItem take that into account when calculating the
    height it will skip.

    I'm asking because I have 2 DynamicForms which render side-by-side
    using an HLayout and I would have liked to have both to remain aligned when
    rows are skipped, even though they are 2 separate DynamicForms.

    For now a "dirty" workaround I found was to specify a height : '34px' on the
    actual RowSpacerItem, but that's not very elegant.

    Is there any other way ? If not, could that feature be added at some point ?

    Thanks in advance for your help,

    #2
    Not completely following - the two forms have different titleOrientation settings?

    If you want them to match heights for a row, why not have a single form?

    Comment


      #3
      Hi,

      Here's the complex layout I'm trying to deal with :

      Code:
      var layout = VLayout.create
      ({
      	membersMargin : 20,
      	width : '98%',	// h-scrollbar appears when 100% (?)
      	height : 400,
      	members :
      	[
      		HLayout.create
      		({
      			membersMargin : 40,
      			height : '*',
      			members :
      			[
      				DynamicForm.create
      				({
      					width : '50%',
      					numCols : 1,
      					titleOrientation : 'top',
      					fields :
      					[
      						{ type : 'RowSpacerItem', height : '53px' },
      						{ name : 'DimensionType.Name' },
      						{ name : 'NameEng' }
      					]
      				}),
      
      				DynamicForm.create
      				({
      					width : '50%',
      					numCols : 2,
      					titleOrientation : 'top',
      					fields :
      					[
      						{ name : 'A' },
      						{ name : 'B', type : 'button', buttonConstructor : 'IButton', startRow : true, endRow : false },
      						{ name : 'C', type : 'button', buttonConstructor : 'IButton', startRow : false, endRow : true },
      						{ type : 'RowSpacerItem', height : '17px', colSpan : 2 },
      						{ name : 'D', colSpan : 2 }
      					]
      				})
      			]
      		}),
      
      		HLayout.create
      		({
      			membersMargin : 40,
      			height : '100%',
      			members :
      			[
      				VLayout.create
      				({
      					width : '50%',
      					members :
      					[
      						DynamicForm.create
      						({
      							height : '100%',
      							numCols : 1,
      							titleOrientation : 'top',
      							fields :
      							[{
      								name : 'AA'
      							}]
      						})
      					]
      				}),
      
      				VLayout.create
      				({
      					width : '50%',
      					members :
      					[
      						DynamicForm.create
      						({
      							height : '100%',
      							numCols : 1,
      							titleOrientation : 'top',
      							fields :
      							[{
      								name : 'BB'
      							}]
      						})
      					]
      				})
      			]
      		})
      	]
      });
      The reason for multiple DynamicForm is because they bind to different data sources.

      This is somewhat a 2x2 matrix where all 4 DynamicForms must aligh to one another. I did look into TileLayout but didn't manage to have the layout above properly render with that Layout manager.

      How could I eliminate that RowSpaceItem's height attribute?

      Comment


        #4
        Not sure if this is the problem, but height should always be specified as a number, not a String with px.

        Comment


          #5
          I changed my layout so that I can avoid using RowSpacerItem altogether.

          Thanks,

          Comment

          Working...
          X