I am trying to restrict my datagrid cell input so that it only accepts numbers. I create my Datagrid columns in actionscript instead of mxml.
I am trying to assign a textInput to ItemEditor property of datagridcolumn.
var newColumn : DataGridColumn = new DataGridColumn(s); // si s the header string
newColumn.editable = true;
var ti : TextInput = new TextInput();
ti.restrict = "0-9";
newColumn.itemRenderer = ti as IFactory;
However, this does not work. Anyone have better suggestions on restricting datagrid cell input ??
You have to use a factory. It will be more like:
Var tif:ClassFactory = new ClassFactory(TextInput);
Tif.properties.restrict = "0-9";
NewColumn.itemRenderer = tif;