DataSet DataGrid CellRenderer bug?
Hi I'm attempting to bind a DataSet to a DataGrid with the CellRenderer included. I'm experiencing some bugs that I've reported to Macromedia. Any ideas on how to fix these issues?
Bug1: If you click on a CheckBox in the DataGrid, after the CheckBox (Select) column has been sorted, the column gets automatically sorted subsequent to clicking on a CheckBox – confusing behavior.
Bug2: If you scroll to the bottom of the DataGrid and click on a CheckBox, the scrollbar jumps back up to the top of the grid automatically – also confusing.
Recreation Steps:
1)-Add DataGrid (instance name: dgDataGrid) and DataSet (instance name: dsDataSet) to stage.
2)-Bind dataProvider of DataSet to dataProvider of DataGrid
3)-Add fields to Schema of DataSet
4)-Add CellRenderer for Check Box by adding creating MovieClip with AS 2.0 class of mx.controls.cells.CheckCellRenderer
5)-Add data to DataSet using dataProvider in ActionScript
Bindings: dataProvider of DataSet is bound to dataProvider of DataGrid, direction in/out
Schema: Add Type:String, Color:String, and Select:String to DataSet schema
ActionScript on first frame:
//import classes and define datatypes
import mx.controls.gridclasses.DataGridColumn;
var fruit:Array
var dsDataSet:mx.data.components.DataSet
var dgDataGrid:mx.controls.DataGrid
//Data
fruit = new Array()
fruit.push({Type: "Banana", Color: "Yellow"})
fruit.push({Type: "Apple", Color: "Red"})
fruit.push({Type: "Orange", Color: "Orange"})
fruit.push({Type: "Tomato", Color: "Red"})
fruit.push({Type: "Strawberry", Color: "Red"})
//
//
//---------create columns and apply renderer--------------
var column:mx.controls.gridclasses.DataGridColumn;
//
column = new DataGridColumn("Select");
column.headerText = "Select";
column.width = 45;
column.cellRenderer = "CheckCellRenderer";
dgDataGrid.addColumn(column);
//
column = new DataGridColumn("Type");
column.headerText = "Type";
column.width = 75;
dgDataGrid.addColumn(column);
//
column = new DataGridColumn("Color");
column.headerText = "Color";
column.width = 75;
dgDataGrid.addColumn(column);
//
//add Data to dataSet
dsDataSet.dataProvider = fruit
|