A few hours ago I’ve asked how to create a custom component (textInput and label component and created a Component Definition) and with your answers I can do that now.
Problem 2: I’d like to use that component in a datagrid column so that the user can type a value in the textInput which will in turn update the underlying dataprovider.
I know I should use a cellrenderer like I’ve done with a checkbox column (also with help on the Net), but at this stage I’m only pulling my hair out.
Please help.
This might look messy as it’s a modified example.
Make sure you have the DataGrid, Label and TextInput components in the library of the fla you want to try this:
And the CustomCell class looks like this:
The code mostly comes from this devnet article.
It works ok, as in, it’s editable.
Solution is be a component class(a class extending fl.core.UIComponent), implementing the ICellRender interface so it can be set as a renderer, and containing the Label and TextInput components. Also data will be mapped to TextInput.text, so it can be easily edited.
If DataGrid is a bit bloated, and you want to use the Component Definition or something simpler. I guess you can hack together a solution using a List and setting a custom cellRenderer using styles.
I’m guessing custom clips are used as a cell renderer in the Plugins list on the tweenlite page.
HTH,
George