Monday, July 27, 2009

Flex : Advanced Data Grid - The solution to Keyboard Navigation

Context:
We were in the process to achieve keyboard navigation using Flex on DataGrid. The DataGrid would contain editable and non-editable cells. The proof of concept (POC) started when Flex Builder 2.0 was the only version available.

The proof of Concept:
We figured out working with keyboard event and synchronizing the data and itemEditors would require us lot more effort to come up with a generic component which will not be full proof despite all the testing.

The next step:
The features of Flex 3.0 were released around that time which provided us with a hope. Flex was releasing AdvancedDataGrid and single cell selection was one of the features. We decided to use wait for Flex 3.0 and use AdvancedDataGrid for this implementation.

The pros:
Grouping functionality is great and works wonders with multi level grouping
Allows single cell and multiple cell selections
Objective hierarchy is simple - all the components have a parallel implementation with "Advanced" prefixed. e.g. DataGridColumn and AdvancedDataGridColumn

The cons:
A parallel implementation was required in our code for all the components referring to DataGridObjects as AdvancedDataGrid and DataGrid components do not share the common parent.
For being a Java Developer - it makes life difficult if one cannot utilize polymorphism.
Known bugs required us to take work around way for being early implementers e.g. http://bugs.adobe.com/jira/browse/FLEXDMV-2084

Lessons Learnt:
There are bugs still being fixed in the released component e.g. possible memory leak and single cell selection mode not working in editable mode when some columns are editable and some are not.

Conclusion:
Despite known issues - its great to have a keyboard friendly flex component available. I am sure Adobe will look into making the component more stable and introduce more features with its gaining popularity

No comments:

Post a Comment