Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

column headers on datagrid component

Status
Not open for further replies.

womblies

Programmer
Feb 28, 2003
62
IE
still having problems with tdk datagrid component.i have to hard code in the column names to fill the grid(creating new recordset)

i'm using flash remoting to return info from a database which i want to display this in the datagrid

i get a recordset back and the debugger shows in this format
List
-(0)
-eusfn " info "
-eusln " info "
-(1)
-eusfn " "
-eusln " "
etc.
or to reference it
List(0).eusfn

eusfn, eusln is what i want to be the column header in the datagrid as that is the column header used in the database

has anyone got any ideas on what to do
 
yeh this does seem to be a problem dont it. dynamic loading of headers.

i am very busy at the moment so i dont have time to dig into it however i have emailed the author of the component for the solution. it can be done as he makes mention of it in an article.

ill post the answer once i get it.
 
update

jusr tried it myself and had no problem. i didnt create a new recordset just dealt with the data from a cfc component.

can you either post your code or better still give a link to the fla
 
#include "NetServices.as"
#include "NetDebug.as"

pUSCD0001 ="0";
pTRANSA =" ";
pSIOS ="1";
pREDIRECT =" ";
pSUSER =" ";
pSPASS =" ";
pORDERBY =" ";
pRELOAD =" ";
pXMLFLAG ="No";
pFLD =" ";
pMESSAGE =" ";
Target ="C Frame";

if (inited == null) {
inited = true;
NetServices.setDefaultGatewayUrl(" gatewayConnection = NetServices.createGatewayConnection();
Title = gatewayConnection.getService("vcfit.VcfitVcm085DSB", this);
}
// call the service functions
_root.Title.flash( pUSCD0001, pTRANSA, pSIOS, pREDIRECT, pSUSER, pSPASS, pORDERBY, pRELOAD, pXMLFLAG, pFLD, pMESSAGE, Target);

//get the results back from database
function flash_Result(result){
List = result;
//this is where i was trying to set the recordset returned to the grid but it did nothing
//grid.setRecordSet(List);
//grid.refresh();

here is where i created the new recordset and filled the grid with the returned info
rc = new RecordSet(["User", "Firstname", "Surname", "Password", "Phone", "Fax", "Mobile", "Email"]);
i=0;
for (object in List){
rc.addItem({User:List.euscd, Firstname:List.eusfn, Surname:List.eussn, Password:List.euspw, Phone:List.eusph, Fax:List.euspf, Mobile:List.eusmo, Email:List.eusem});
i++;
}
grid.setRecordSet(rc);
grid.refresh();

}

stop();
 
assuming that the returned data is a recordset (if its not then you cant dynamically set column headings)
Code:
Title = gatewayConnection.getService("vcfit.VcfitVcm085DSB", new Result());

function myResults() { 
this.onResult = function(myResults) {
for(var i = 0; i < myResults.getLength();i++){
trace(myResults.items[i].User);
trace(myResults.items[i].FirstName;
//etc. etc.
}
}
}
 
was not able to get this working as new Result() line was returning an error

NetServices warning 3: There is no defaultResponder, but no responder was given in call to flash
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top