Someone know what wrong in this code, plz help me Thanks
import fl.controls.DataGrid;
import fl.controls.TextInput;
import fl.controls.dataGridClasses.DataGridColumn;
import fl.data.DataProvider;
//*******************************************************************//
var dp:DataProvider = new DataProvider();
dp.addItem({item:"Asparagus", price:"Rapid Move"});
dp.addItem({item:"Brussel Sprouts", price:"0.27" });
dp.addItem({item:"Cabbage", price:0.04 });
dp.addItem({item:"Cauliflower", price:0.16 });
dp.addItem({item:"Cauliflower", price:0.16 });
dp.addItem({item:"Cauliflower", price:0.16 });
dp.addItem({item:"Cauliflower", price:0.16 });
dp.addItem({item:"Cauliflower", price:0.16 });
dp.addItem({item:"Cauliflower", price:0.16 });
//*******************************************************************//
var itemCol:DataGridColumn = new DataGridColumn("item");
itemCol.headerText = "Command:";
//*******************************************************************//
var priceCol:DataGridColumn = new DataGridColumn("price");
priceCol.headerText = "Description:";
priceCol.labelFunction = priceLabelFunction;
priceCol.sortOptions = Array.NUMERIC;
var myDataGrid:DataGrid = new DataGrid();
myDataGrid.addColumn(itemCol);
myDataGrid.addColumn(priceCol);
myDataGrid.dataProvider = dp;
myDataGrid.width = 200;
myDataGrid.rowCount = myDataGrid.length;
myDataGrid.move(10, 40);
addChild(myDataGrid);
//*******************************************************************//
function priceLabelFunction(item:Object):String {
return "" + Number(item.price).toFixed(2)}
itemTextInput.addEventListener(Event.CHANGE, changeHandler);
function changeHandler(event:Event):void {
var arr:Array = dp.toArray();
var filteredArr:Array = arr.filter(filterDataProvider);
myDataGrid.dataProvider = new DataProvider(filteredArr)}
//*******************************************************************//
function filterDataProvider(obj:Object, idx:int, arr:Array):Boolean {
var txt1:String = itemTextInput.text;
var txt2:String = obj.item.substr(0, txt1.length);
if (txt1.toLowerCase() == txt2.toLowerCase()){
return true}
return false}