Flex HorizontalLayout - hide child element - apache-flex

I have a spark group with layout set to horizontal. The group contains a bunch of buttons and custom controls (it's kind of like a toolbar).
Every now and then I need to conditionally hide a couple of the elements in the toolbar.
I can set the visibile attribute to false and it hides it, but the layout doesn't change, it leave a big blank gap.
I would like the horizontal layout group to re-arrange the items so that it doesn't leave a gap where the invisible items are.
Is it possible?
Is there an attribute I can use on my element to tell the layout to ignore them and redraw itself?

You will want to set includeInLayout to false or bind it to the visible property. This will make sure that when it is invisible it is not accounted for in the layout.
<s:Label text="Test"
id="myLabel"
includeInLayout="{myLabel.visible}"
visible="false" />

Related

Creating a scrollbar for a s:Panel in Flex

I am new to flex development.
In my proj, I have created a panel using this
<s:Panel x="46" y="193" width="75%" height="75%" dropShadowVisible="false">
what happens here is that, the part of the panel goes out of the browser view and I need to include scrollbars so that I can scroll to the right end and bottom end of the panel itself.
I would like to know how I can add scrollbars to the s:panel.
wrap it with a scroller! ;)
<s:Scroller>
...your content to scroll...
</s:Scroller>
In order to use your own scrollbars you need three things:
1. Your main (parent) container should implement IViewport (any subclasses of s:Group would do)
2. Set container's property 'clipAndEnableScrolling' to 'true'.
3. You assign this main container as 'viewport' property of your scrollbar.
HTH,
FTQuest

aspx radiobutton control list in one line

http://www.codetoad.com/asp.net/aspnetcontrols11.asp
Is it possible to have radiobutton control list in one row. Now it is in 3 rows.
You need to use the RepeatDirection and RepeatLayout properties of the RedioButtonList control.
There are several ways of getting the layout you want - I suggest reading the documentation of both properties in order to make an informed decision on which one is most suitable for your situation.
In your RadioButtonList set the property of RepeatLayout="Flow" and RepeatDirection="Horizontial". This will make items in a radio button list horizontal instead of vertical.
Why dont you try adding each radio button to <div> or <li> tag and then set float:left in Css for each <li>. That way i think it will render in one line. Just make sure to set width:__ style to accommodate all radio buttons

Dojo DataGrid - preventing column resize

Is there a way to set a fixed column size in Dojo DataGrid, and not allow it to be resized by the user? Thanks.
The cells defined within the grid's structure support a boolean noresize property. Setting this to true will disable resizing on that particular cell.
You might want to do something about overriding the default CSS though - it appears to use a rather noticeable cursor when hovering over non-resizable cell boundaries.
You can also set a specific width of a column in the structure using the width property on a particular cell.
Example: http://jsfiddle.net/kfranqueiro/qNfC9/

Adapting the width of a Flexs 3 DataGridColumn to the content of its ItemRenderer?

I have the following scenario :
A Flex 3 DataGrid is sitting here
At runtime, a column is added to this grid
The column has a custom ItemRenderer
The ItemRenderer inherits from HBox, and adds a few items to the HBOx dynamically
My problem is that the width of the column doesn't change. As a consequence, my column stays small, and an ugly horizontal scrollbar is displayed in the line, instead of my content (which is completely unreadable).
I would like the column to adapt its width to the content of the HBox in the ItemRenderer. I tried the following :
Setting the 'percentWidth' of the ItemRenderer to '100'
Invalidating the properties of the ItemRenderer after adding the items
The only thing that has a "visible" effect it to force the width of the DataGridColumn. Obviously this is not acceptable since I'm dynamically adding components to the ItemRenderer, and I don't know how many or how big they are.
Besides, when I am in the ItemRenderer, I have no access to the column itself (or do I ?) so I cannot force the size of the column from here.
So is there a way around this ? Would AdvancedDataGrid help here (notwhistanding the fact that I cannot really use it for other reasons ...)
Alternatively, I would be happy enough if someone has a solution where the column cell is displayed without the ugly horizontal scrollbar (don't mention setting horizontalScrollPolicy to "off", been there, tried that, lost shirt ;) ).
Thanks
PH
I did not found a solution for the size, however I found the way to remove the scrollbar ; you must put the "horizontalScrollPolicy : 'off'" in the list of properties of the itemRenderer Factory (rather then on the itemRenderer itself).

Flex: Displaying more than 5 things at a time in a DropDown (ComboBox)

I have a ComboBox in Flex with about 20 items. How do I display all of them in a dropdown with no scroll bar? Right now, Flex displays 5 at a time in the dropdown and puts a scrollbar to scroll for more.
Here's an example:
http://blog.flexexamples.com/2008/07/18/setting-the-dropdown-menu-border-thickness-and-border-color-on-a-combobox-control-in-flex/#more-711
How do I make the dropdown bigger in this example so it shows all 10 items at once?
Found it: 'rowCount' is the property to change. It defaults to 5.
For ones who search for same thing for spark combo:
for spark components that extend SkinnableDataContainer (including ComboBox) you can specify layout with
requestedMinRowCount , requestedMaxRowCount
properties, and do as much changes as you want with the help of skin(this layout directly goes to DataGroup skinpart inside skin).

Resources