STRATEGICAMS
asked on
How to allow selective edit of rows in a Adobe FLEX 2 datagrid based on an XML defintion of which rows can be edited
Question on Adobe Flex Datagrid and XML:
We have a complex XML file which contains a definition of which fields can be edited on certain screens. For example, we define Screen A consists of field 1, 2, 3. Screen B consists of field 1,2,3,4,5,6,7 etc... The field defintion includes the field name, whether it should be editable etc. and some other attributes.
We want to bind the list of screens defined in the XML file (e.g. A, B) to a drop-down list box and when the user selects an item, we want to bind the fields for that chosen screen to a datagrid.
Then, in the datagrid when the user clicks on a row, we want to say if the editable property defined for that field that has just been selected is editable = true then we want to allow the user to type in a value. If the XML file for that Field defintion says editable = false then the users click on that row would be ignored. Using the XML file will allow us to add fields or change their properties without having to recompile the application.
Any suggestions greatly appreciated.
We have a complex XML file which contains a definition of which fields can be edited on certain screens. For example, we define Screen A consists of field 1, 2, 3. Screen B consists of field 1,2,3,4,5,6,7 etc... The field defintion includes the field name, whether it should be editable etc. and some other attributes.
We want to bind the list of screens defined in the XML file (e.g. A, B) to a drop-down list box and when the user selects an item, we want to bind the fields for that chosen screen to a datagrid.
Then, in the datagrid when the user clicks on a row, we want to say if the editable property defined for that field that has just been selected is editable = true then we want to allow the user to type in a value. If the XML file for that Field defintion says editable = false then the users click on that row would be ignored. Using the XML file will allow us to add fields or change their properties without having to recompile the application.
Any suggestions greatly appreciated.
ASKER
hobbit72 could you elaborate a little as I can't quite understand how to implement this. some examples / snippets would be extremely helpful if possible.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<mx:DataGridColumn editable="{@editable==true
Or on a per row basis by capturing the datagrids itemEditBeginning event and calling preventDefault() based on the contents of the event targets itemEditorInstance