DataGrid: can I recover the data, BUT it does not show the datagrid control

Hello

Hi - I've traced data through php mysql in actionscript but it does not show the datagrid control. Here is my code.

Import fl.controls.DataGrid;

Import fl.controls.dataGridClasses.DataGridColumn;

Import fl.data.DataProvider;

Import fl.controls.ScrollPolicy;

Import fl.managers.StyleManager; necessary to format the text in cells

import flash.display.MovieClip;

import flash.net.URLRequest;

import flash.events.Event;

import flash.events.MouseEvent;

import flash.net.URLLoader;

to import flash.net.URLVariables;

import flash.net.URLRequestMethod;

import flash.net.URLLoaderDataFormat;

Create a new instance of the DataGrid component.

var aDg:DataGrid = new DataGrid();

var myDp:Array = new Array();

var myData:URLRequest = new URLRequest ("http://www.cambridgekids.es/kglad/php/getUsers.php");

myData.method = URLRequestMethod.POST;

var loader: URLLoader = new URLLoader();

loader.dataFormat = pouvez;

loader.addEventListener (Event.COMPLETE, dataOnLoad);

Loader.Load (mydata);

function dataOnLoad(evt:Event) {}

for (var i: uint = 0; i < evt.target.data.cant; i ++) {}

myDp.push ({number: evt.target.data ["firstname" + i], Apellido:evt.target.data["lastname"+i]});})

/ / trace (evt.target.data ["firstname" + i]);

}

myDp.dataProvider = new DataProvider (myDp);

}

aDg.dataProvider = new DataProvider (myDp);

aDg.columns = ['number', 'Apellido'];

aDg.setSize (800,300);

aDg.move (150,200);

aDg.rowHeight = 40; / / allows 2 lines of text in the default text size.

aDg.columns [0] .width = 80;

aDg.columns [1] .width = 30;

aDg.resizableColumns = true;

aDg.verticalScrollPolicy = ScrollPolicy.AUTO;

addChild (aDg);

DOH! I thought I was in the flex forum so ignore my previous answer.

You must set the dataProvider on the dg after completing the dataprovider with data so spend aDg.dataProvider = new DataProvider (myDp); at the end of the dataOnLoad method

Tags: Adobe Animate

Similar Questions

Maybe you are looking for