Load directly from php as DataProvider for datagrid
hi
the normal method load data php in datgrid push , array first...:
for(var i:uint=0; i<event.target.data.dgrows; i++)
{
dgarr.push
({
id:event.target.data["id"+i],
datelogged:event.target.data["datelogged"+i],
quotenumber:event.target.data["quotenumber"+i],
clientponum:event.target.data["clientponum"+i],
compname:event.target.data["compname"+i],
exclusive:event.target.data["exclusive"+i],
tax:event.target.data["tax"+i],
inclusive:event.target.data["inclusive"+i]
});
}
dg1.dataprovider = new dataprovider(dgarr);
what i'd know if possible pass "event.target.data" directly dataprovider, tried didn't work obvious reasons: dg1.dataprovider = new dataprovider(event.target.data);
basically want code doesn't have change each php file , reduce amount of coding lines eg. want eliminate\change 'dynamic':
"for(var i:uint=0; i<event.target.data.dgrows; i++) {dgarr.push({ ....... });"
something awesome...
for(var key:string in map)
{
dgarr.push
({
key : map[key]
});
}
(the above code add row each key actually represent column totally not required , empty because "key" must indicate.... )
help appriciated
yes, if php returned data in appropriate xml format.
More discussions in ActionScript 3
adobe
Comments
Post a Comment