Welcome, Guest. Please login or register.
Did you miss your activation email?
05/22/12, 07:40
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  Flash and AS 3 (Moderators: papachan, kofi addaquay)
| | |-+  Play around with dataGrid
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Play around with dataGrid  (Read 1648 times)
hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« on: 01/18/10, 21:56 »

Hello, i have some question

to count the Column we can use
Code:
dataGrid.getColumnCount();

but how to count the rows?..
Code:
dataGrid.getRowCount();
the code above is error, because there is no method about that..

I just know rowCount that just attribute not a method but when i try to do with it
Code:
dataGrid.rowCount;
Thats always show '5', although i just have 2 rows in my data Grid..

And how to get the Row / Count Index?..

I mean i want to trace("The Selected Rows / Column") and the return is Integer..

Example i want to click the first data in the first column then the output is '0,0'.. how to do that?..

thank you.. Smiley
Logged

Huihihi~ Cheesy
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #1 on: 01/19/10, 07:37 »

Are you sure you're talking about AS3?

Jorge
« Last Edit: 01/20/10, 07:19 by Jorge Solis » Logged

hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« Reply #2 on: 01/19/10, 18:09 »

wew i am using AS3 to make the data Grid

there is the package for that..

Code:
import fl.controls.DataGrid;

In the right side of my Adobe Flash editor, there is 'Action Script 3.0'
I am really use Action Script 3.0 for this..

Because now, i never use the AS2.. Smiley

Thank you.. Cheesy
« Last Edit: 01/20/10, 07:43 by hinomotoblade » Logged

Huihihi~ Cheesy
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #3 on: 01/20/10, 07:26 »

Sorry, my mistake, long time whithout using Flash datagrid. The thing is that rowCount is the number of rows that are at least partially visible in the list. There´s no items array as in AS2 so you should check the length of the dataProvider to know how many rows you will have

Jorge
Logged

hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« Reply #4 on: 01/20/10, 07:40 »

Oh yes nevermind.. Smiley

umm, how to count the dataProvider? Jorge.. Smiley

I just know about the rowCount today, that it display how many row that can be able to visible in the height of the dataGrid, for example i have 2 data so that should have 2 rows, and in my dataGrid, 1 data have 30 rowHeight, so i have 60 rowHeigth for 2 data, but when i change to just 30 height of data grid, the rowCount just output 1, when i extended the height to 150, although i just have 2 data, it will show the output to 5..

Smiley

Thanks a lot Jorge, thank you for replying me Smiley

Logged

Huihihi~ Cheesy
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #5 on: 01/20/10, 09:39 »

Ok, a step back ... how you populate your datagrid?

Jorge
Logged

hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« Reply #6 on: 01/21/10, 04:41 »

what do you mean, Jorge?.. Smiley

Humm how i use the dataGrid for?.. :O

thank you again Jorge Smiley
Logged

Huihihi~ Cheesy
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6175


View Profile WWW Email
« Reply #7 on: 01/21/10, 05:46 »

how do you assign the data to the grid?

do you use grid.dataProvider=....

or doe you use grid.addItem( ....
Logged

happy flashing
Cool
Ronald
hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« Reply #8 on: 01/21/10, 08:51 »

Ohh.. Smiley

first i am importing the dataGrid controls

Code:
import fl.controls.dataGrid;

Then i made somo or more object like this :

Code:
var variableName:Object = {COLUMNNAME1:"Your first data (0,0)",COLUMNNAME2:"your second data (0,1)"}

then u can make the data grid in two ways, make with make the new dataGrid Object, or drag over the dataGrid Component in the stage.. Smiley

if you want to make the new object of the dataGrid, here :

Code:
var dataGridObjectName:dataGrid = new dataGrid();

Then make the Column name like this :

Code:
dataGridObjectName.columns = ["COLUMNNAME1","COLUMNNAME2"];

Nah then i add the Object that i have made to the dataGrid like this :

Code:
dataGridObjectName.addItem(variableName);

Then u can make that position or some extra attribute to modify your dataGrid..

Smiley

Nah my question is how to get the rowCount that dataGrid.. Smiley
Then how to get the index of my item in data Grid, for example i want to get the first data in my first column and first row so i want to make the output like '0,0'..

about the rowCount, its not a method but just the attribute..

Nah the problem is, the rowCount show how many rows in your dataGrid which can visible or match with your height of your dataGrid..

For Example i have the Script like this

Code:
dataGridObjectName.height = 150;
dataGridObjectName..rowHeight = 30;

Nah thats mean that if i have 2 data in my dataGrid that should have output 2.

but different, thats output is 5, because if we have 30 row height, the row that can be visible is 5 (30*5 = 150), although i just have 2 data in my dataGrid.. Smiley

Thank you, wish can help you too about the dataGrid Component in AS3.. Smiley






Logged

Huihihi~ Cheesy
hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« Reply #9 on: 01/22/10, 04:25 »

XD still wish some help Cheesy

Nah my question is how to get the rowCount that dataGrid.. Smiley
Then how to get the index of my item in data Grid, for example i want to get the first data in my first column and first row so i want to make the output like '0,0'..

Thanks, Thanks so much Cheesy
Logged

Huihihi~ Cheesy
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #10 on: 01/22/10, 07:46 »

Yo're adding strange objects like this one:

var variableName:Object = {COLUMNNAME1:"Your first data (0,0)",COLUMNNAME2:"your second data (0,1)"}

Put many objects like this inside an array named DP, then assign as the dataProvider of your datagrid, i.e

vad DP:Array = [{Name:"Pepe", Age:8}, {Name:"Peter", Age:30}, {Name:"Ana", Age:25}]

The datagrid will have 2 columns, Name and Age and three rows.

How many rows?
DP.length

Column Name at row 0?
DP[0].Name

Jorge
Logged

hinomotoblade
Seasoned Programmer
***
Posts: 131


Flash Never Die :D


View Profile
« Reply #11 on: 01/22/10, 08:44 »

Waw you are genius Cheesy

Thank you Jorge.. Cheesy

by the way i really like this emotion >> Cheesy hehe
Logged

Huihihi~ Cheesy
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything