Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-19-2012, 02:33 AM   #1
ronaldhutasuhut
Registered User
 
Join Date: May 2012
Posts: 5
Wink Get specified Array items

Hello all,

I need a favor,

Q:How to get a group of an Array specified item, and then show it in a cell of DataGrid?

The problem looks like this:

I have an array:
ActionScript Code:
var arr:Array=new Array('1','2','3','4','5');

and a DataGrid:
ActionScript Code:
var dg:DataGrid=new DataGrid(); dg.columns=["Col1","Col2"];

I want to add a group of specified arr Array to Col1 and Col2:

Col1 data will be = 1,4,5
Col2 data will be = 1,2,4

It's not like 'push', 'splice', 'slice','shift', etc. I just want to simply gathered a single array item with another to be a group in DataGrid as an Item. It should be like this:

dg.addItem({Col1:arr[0] and arr[3] and arr[4], Col2:arr[0] and arr[1] and arr[3]});

Can we do that? If we can, how to write the code correctly?

Thanks for your help!

Last edited by ronaldhutasuhut; 05-21-2012 at 02:00 AM. Reason: Wrong door to ask this question, sorry :)
ronaldhutasuhut is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:11 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.