How to retrieve column names from XML or database?
hello. want populate datagrid column names (not values of columns) of entity in database (or xml file. can tell me how tackle this?
thanks support.
thanks support.
ideally want make remote procedure call schema information given domain model returns column names, however, here simple example using e4x extract "column" names inline xml data.
<?xml version="1.0" encoding="utf-8"?>
<mx:application xmlns:mx=" http://www.adobe.com/2006/mxml" initialize="initapp()">
<mx:datagrid id="customers" />
<mx:xml id="custdata" xmlns="">
<customers>
<customer name="bob" company="adobe" />
<customer name="sam" company="google" />
<customer name="susan" company="yahoo" />
</customers>
</mx:xml>
<mx:script>
<![cdata[
import mx.controls.datagridclasses.datagridcolumn;
import mx.controls.list;
private function initapp():void
{
var columnnames:xmllist = custdata.customer[0].attributes();
var columnlist:array = [];
(var i:int=0; i<columnnames.length(); i++)
columnlist.push(new datagridcolumn(columnnames .name()));
customers.columns = columnlist;
}
]]>
</mx:script>
</mx:application>
hope give start.
<?xml version="1.0" encoding="utf-8"?>
<mx:application xmlns:mx=" http://www.adobe.com/2006/mxml" initialize="initapp()">
<mx:datagrid id="customers" />
<mx:xml id="custdata" xmlns="">
<customers>
<customer name="bob" company="adobe" />
<customer name="sam" company="google" />
<customer name="susan" company="yahoo" />
</customers>
</mx:xml>
<mx:script>
<![cdata[
import mx.controls.datagridclasses.datagridcolumn;
import mx.controls.list;
private function initapp():void
{
var columnnames:xmllist = custdata.customer[0].attributes();
var columnlist:array = [];
(var i:int=0; i<columnnames.length(); i++)
columnlist.push(new datagridcolumn(columnnames .name()));
customers.columns = columnlist;
}
]]>
</mx:script>
</mx:application>
hope give start.
More discussions in LiveCycle Data Services
adobe
Comments
Post a Comment