This is a Flex 4.5 library project containing a number of custom components.
I am in the process of making sample, demo applications to showcase each of the components. But until that is realeased, feel free to explore the source code by yourselves.
This is a custom implementation of the Spark DropDownList.
The SoupedUpeDropDownList contains two main features:
- A built-in button which allows the user to clear the selection in the drop down list.
- Shows validity indications in the component by highlighting the component in different colors, green for "valid" and red for "error".
Please visit this page to view a demo of the component. The source of the demo application is also available there.
Based on the Spark DataGrid, the AwesomeDataGrid adds the following additional features.
Note: To utilize these features, the AwesomeDataGrid should be used along with the accompanying custom GridColumns (like AwesomeGridColumn) and custom GridItemRenderers (like AwesomeGridItemRenderer).
- Supports the prevention of selection of rows when certain columns are clicked. The user can specify these
no selectcolumns. - Supports having an edit button in a cell, which, when clicked, opens the item editor of the cell.
Based on the AwesomeDataGrid, the SetDPSelectedDataGrid sets a specific property called selected on the data provider's item when that item is selected in the DataGrid.
Sounds simple, but saves major hassle for such a common task as this.
Based on the SetDPSelectedDataGrid, the AutoMultiSelectDataGrid allows selecting multiple rows in the DataGrid without the need to press any additional keys.
Again, this is a very commonly needed feature. This component saves a lot of time, being a drop-in replacement for the original Spark DataGrid.
Based on the plain old Spark GridColumn, the AwesomeGridColumn supports the following additional properties.
- selectable - Will clicking on a row in this column cause the row to be selected?
- validityProperties - A comma-separated list of Boolean properties on the data provider item. These items are called to ascertain the validity of the cell in this column. If any of the properties return false, the item renderer highlights the cell with the invalid property. Note: You need to use the
AwesomeGridItemRendererfor this property to take effect. - validityErrorString - The error string to display on the cell when an invalid cell is found by evaluating the
validityPropertiesproperty. - textRestrict - The restriction on the types of characters allowed to be entered in the itemEditor of this column.
- textMaxChars - The max number of characters that can be entered in the itemEditor of this column.
- allowDuplicates - Can duplicate values exist in this column?
Based on the AwesomeGridColumn, the CheckBoxGridColumn is built to hold the CheckBoxGridItemRenderer. As the name suggests, this column displays a check box in each row. It has the following features.
It has a custom header renderer which is a three state check box. The header displays one of its three states:
- Unticked - If all check boxes in the column are unticked.
- Partial - If some check boxes in the column are ticked, but not all.
- Ticked - If all check boxes in the column are ticked.
The CheckBoxGridColumn supports the following properties.
- headerClickable - Can the header be clicked to mass-select or mass-unselect all the check boxes in the column?
- controlProperty - Is there a specific Boolean property of the data provider items which the check boxes are supposed to mimic? If no property is specified, the check boxes mimic the selection of the row.
- canEditItemRendererProperty - Check this boolean property on the data provider to determine if the
controlPropertyis allowed to be edited.
Based on the Spark GridItemRenderer, the AwesomeGridItemRenderer is the heart behind all the features of the AwesomeGridColumn. The properties set on the AwesomeGridColumn take effect in this item renderer.
- Verifies the validity properties.
- If any validity property evaluates to false, the item renderer shows an error state.
- If specified, shows the error string.
- If the column and the data grid are editable, shows the edit button on the cell.
Based on the Spark GridItemRenderer, the CheckBoxGridItemRenderer is one major part of the feature-set of the CheckBoxGridColumn (the other being the CheckBoxGridHeaderRenderer).
This item renderer renders a check box and takes care of either mimicking either the controlProperty of the data provider item or the selection status of the data grid row.
If a particular row's canEditItemRendererProperty returns false, then the CheckBoxGridItemRenderer will not be editable.
Based on the Spark GridItemRenderer, the RadioButtonGridItemRenderer is very similar to the CheckBoxGridItemRenderer in that it mimics the selection status of the row. This item renderer is meant to be used in those data grids which have a selectionMode of singleRow.
Please visit this page to view a demo of the component. The source of the demo application is also available there.
Based on the Spark GridItemRenderer, the CheckBoxGridHeaderRenderer is the designated header for the CheckBoxGridColumn. It displays a check box which supports three states according the check boxes' selection status in the CheckBoxGridColumn. This is explained in the CheckBoxGridColumn section above.
If the column has a headerText property set, the string is shown beside the check box.
Clicking this header serves as a control to select or unselect all the check boxes in the column. Only the checkboxes which are allowed to be toggled are toggled, based on the canEditItemRendererProperty of each data provider item. The header's three-state checkbox also changes state taking into account the non-toggle-able checkboxes.
Based on the DefaultGridItemEditor, the UsualGridItemEditor adds a couple of frequently used features to the default item editor.
- When opening the item editor, to populate the item editor, if the
dataFieldproperty is not set on the column, then use theitemToLabelmethod of the column to populate the editor. - Implement the
allowDuplicatesproperty of theAwesomeGridColumn. If the entered value is already found elsewhere in the column, then aGridColumnEvent.DUPLICATE_DATA_FOUNDevent is dispatched to the data grid. - When the item editor's data is saved successfully, a
GridColumnEvent.DATA_UPDATED_IN_CELLevent is dispatched to the data grid. - Implements the textRestrict and the textMaxChars properties of the
AwesomeGridColumn. - Trim's the entered data automatically on retrieve.
This is a component based on the Spark TitleWindow component. This is an unobtrusive, non-modal popup window to be used for the purpose of showing notification messages to the user. The notification hides automatically after 3 seconds, unless the user hovers the mouse pointer over it.
Please visit this page to view a demo of the component. The source of the demo application is also available there.
This is a Spark Slider component with a lot of additional features. The component is a fusion of the work of Patrick Mowrer (here and here) and Patrick Heinzelmann. It has been so heavily modified that it retains little resemblance to either of the above components. But full credit to both Patricks for their amazing work which set me in the right direction.
NOTE: Only the horizontal orientation of the slider has been tested extensively. Since I did not need the vertical orientation, I haven't made the skins for it. Anyone who needs the vertical orientation can easily create the required skins by referring to the horizontal version of the skins.
The main features are the following.
- Multiple thumbs can be displayed. Thumbs can be fixed or movable.
- A colored track highlight can be shown between the thumbs.
- accentColors - The color of the track highlights can be specified as an array of
accentColors. - The colors from the array will be used in the order in which they were specified in the array, to highlight the consecutive track intervals.
- If the number of track intervals is greater than the number of colors in the
accentColorsarray, then the colors will be repeated from the start of the array again. - showTrackHighlight - Using this property, you can control if you want the colored track highlights to be shown.
- accentColors - The color of the track highlights can be specified as an array of
- A label can be assigned and displayed for each interval between the thumbs. The label can be edited in-place.
- The component accepts a
dataProviderobject which is used to compute the position of the thumbs and display the labels.- Moving the thumbs and editing the labels updates the
dataProviderimmediately. - Updates to the
dataProviderare reflected immediately in theMultiThumbSlider. - valueField, labelField and fixedValueField properties can be used to specify the properties on the dataProvider objects which should be read to obtain the corresponding information.
- Moving the thumbs and editing the labels updates the
- Thumbs can be added and removed directly from within the component: Unobtrusive 'Add Thumb' and 'Remove Thumb' buttons appear near each thumb on mouse over.
- Apart from thumbs, additional thumb-like, fixed objects called
Markerscan be displayed on the slider.Markerswill not be part of thedataProvider. This is useful when you want to point to a location on the slider using a thumb-like object, but you don't necessarily want that position to be part of thedataProvider.- markers - This is the array which takes the list of values where
markersshould appear.
- markers - This is the array which takes the list of values where
- defaultTrackHighlightLabel - The default label for new thumb intervals can be specified using this property.
- allowDuplicateValues - As the name suggests, you can control if duplicate values are allowed for thumbs. Currently, there are some serious issues with
fixedValueswhen this property is set totrue. I haven't tested this yet. - allowOverlap - As the name suggests, you can control if you want the thumbs to be moved over and beyond one another. Currently, this property is non-functional.