the problem i am facing is that :
the click event is always referring to the last checkbox
since they all have the same instance names .
The following is the function checkBox_Addition_in_ScrollPane()
for adding checkboxes in a scroll pane:
public function chk_func() {
trace("Change in checkbox '" + clip._name + "' to " +
clip.selected+clip.label);
}
function checkBox_Addition_in_ScrollPane() {
this.attachMovie("ScrollPane", "scrollpane1", 520);
scrollpane1.contentPath = "empty_mc";
var y:Number;
y = 10;
var depth:Number;
depth = 530;
for (var i = 0; i<datagrid.columnCount; i++) {
clip = scrollpane1.content.attachMovie("CheckBox",
"cb1", depth);
depth++;
clip._x = 10;
clip._y = y;
y = y+20;
clip.label = obj.d_array[i];
clip.addEventListener("click", Delegate.create(this,
chk_func));
}
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Nathan
Derksen
Sent: Wednesday, February 08, 2006 9:43 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] hiding datagrid columns?
Use removeColumnAt() and addColumn()/addColumnAt()
var dataArray:Array = new Array();
dataArray.push({foo:"1", bar:"2", baz:"3"});
dataArray.push({foo:"1", bar:"2", baz:"3"});
dataArray.push({foo:"1", bar:"2", baz:"3"});
dataArray.push({foo:"1", bar:"2", baz:"3"});
dataArray.push({foo:"1", bar:"2", baz:"3"});
dataArray.push({foo:"1", bar:"2", baz:"3"});
dataArray.push({foo:"1", bar:"2", baz:"3"});
dataArray.push({foo:"1", bar:"2", baz:"3"});
dataArray.push({foo:"1", bar:"2", baz:"3"});
myDG.dataProvider = dataArray;
myDG.removeColumnAt(2);
// Later call the following to get the column back:
myDG.addColumnAt(2, "baz");
Note that the third column of data is not removed from the data
provider when you call removeColumnAt(2), it just removes the visual
representation of the data.
Nathan
http://www.nathanderksen.com
On Feb 8, 2006, at 1:47 AM, <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]> wrote:
> Does anyone know a way to hide a datagrid column.
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of
> the addressee(s)and may contain confidential or privileged
> information. If you are not the intended recipient, please notify
> the sender or [EMAIL PROTECTED]
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s)and may
contain confidential or privileged information. If you are not the intended
recipient, please notify the sender or [EMAIL PROTECTED]
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com