But how can I get the columnNames eg, I thought to pull back one column
would be something like re.return.name, but does not seem to work.

-----Original Message-----
From: JesterXL [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 1 February 2006 2:06 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] datagrid question

I can answer #2; use columnNames.

my_dg.columnNames = ["columnName", "anotherColumnName"]

Only those columns will be shown.


----- Original Message -----
From: "Mark Wheeler" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, February 01, 2006 12:52 AM
Subject: [Flashcoders] datagrid question


Hi
 
I am in the process of developing a flash app that queries our Active
directory, I have created a cf component that queries the AD using
cfldap and returns the query of the AD as an array, I am able to grab
the array from flash (code for the application below) to populate a
datagrid, but what I want to do is be able firstly to filter the
datagrid using text boxes.  Department and name are displayed in the
datagrid and if user types in a text box (name or department) as user
types the datagrid is filtered, I can do this in cfform in coldfusion
but am unsure here.  secondly I can populate the datagrid using
staffListBox.dataProvider = re.result; and remove the unwanted column
with removeColumnAt() but how do I choose the colums that I want to push
into the datagrid, I thought something like re.result.name might work,
but to no avail. Lastly how do I pick up a value in the array returned
that will be passed into a nother query to display further information
about the selected item, to push out to other components, ie name,
email, these are all in the array but can't seem to retreive them, as
something of a newbie to flash, any help to one or all of these
questions would be greatly appreciated.
 
Regards
Mark Wheeler
 
Code:
//import the Flash RemotingClasses
import mx.remoting.Service;
import mx.services.Log;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
import mx.remoting.PendingCall;
import mx.remoting.RecordSet;
import mx.remoting.DataGlue;
//Connect to the gateway
//Establish the service
var employeeService : Service = new Service(
           "http://127.0.0.1/flashservices/gateway
<http://127.0.0.1/flashservices/gateway> ",
           new Log (Log.DEBUG),
           "cfflash.employees",
           null,
           null);
//Test the connection
function getTestConn(){
//Create a pendingCall Object
 var testConn_pc:PendingCall = employeeService.getTestConn();
//Use the responder property to handle the success for failure
 testConn_pc.responder = new RelayResponder(this, "getTestConn_Result", 
              "getTestConn_Fault");
}
//Handle the success
function getTestConn_Result(re:ResultEvent){
 //trace(re.result);
 staffPosition.text = re.result;
 //Call The Staff List method
 listStaff();
}
//Handle the failure
function getTestConn_Fault(re:FaultEvent){
 trace("error");
}
//Get the staff names
function listStaff(){
 var staff_pc:PendingCall = employeeService.listStaff();
 staff_pc.responder = new RelayResponder(this,"listStaff_Result",
           "listStaff_Fault");
}
function listStaff_Result (re : ResultEvent){

//display the results in a datagrid
 staffListBox.dataProvider = re.result;
 staffListBox.removeColumnAt(2);
}
function listStaff_Fault (fault:FaultEvent):Void{
 trace ("error");
}
 
//get the staff Details
function getStaffDetails(userId){
 var staffDetails_pc:PendingCall =
employeeService.listStaffQuery(userId);
 staffDetails_pc.responder = new RelayResponder(this,
"getStaffDetails_Result", "getStaffDetails_Fault");
}
//pass the staff details to other components when the user clicks in the
datagrid
function getStaffDetails_Result(re:ResultEvent){
 this.staffEmail.text = re.result.items[0].mail;
 this.staffDept.text = re.result.items[0].department;
}
function getStaffDetails_Fault(fault:FaultEvent):Void
{
 trace("error");
}
 
var listBoxListener : Object = new Object();
this.listBoxListener.change = function()
{
 var userId:String = staffListBox.selectedItem.data;
 getStaffDetails(userId);
}
this.staffListBox.addEventListener("change", listBoxListener);
 
//Start the application
getTestConn();
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to