Go Back   SmartClient Forums > Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 16th Apr 2009, 19:36
yavery yavery is offline
Registered Developer
 
Join Date: Oct 2008
Posts: 408
Default 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,
Reply With Quote
  #2  
Old 17th Apr 2009, 15:53
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 38,342
Default

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?
Reply With Quote
  #3  
Old 18th Apr 2009, 16:06
yavery yavery is offline
Registered Developer
 
Join Date: Oct 2008
Posts: 408
Default

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?
Reply With Quote
  #4  
Old 22nd Apr 2009, 12:22
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 38,342
Default

Not sure if this is the problem, but height should always be specified as a number, not a String with px.
Reply With Quote
  #5  
Old 22nd Apr 2009, 18:37
yavery yavery is offline
Registered Developer
 
Join Date: Oct 2008
Posts: 408
Default

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

Thanks,
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved