PDA

View Full Version : need DATAGRID help ( more then viewable items gives probs)


remco-v
04-25-2005, 01:37 PM
Hey ive got a funny lil prob here.
I applied a nice cellrendere to my datagrid column 0.
This adds 2 nice things to the column

1 checkbox
1 colored ball to indicate the checkbox state.

Now i am having probs keeping the states in line with the value that is inside the datagrid. When the number of items <= vieuwable items count all works like it should be. but as soon as i place more items than the number of viewable items the last item is giving probs.

It cant be checked
1 extra item is added that sometimes dissapearce.

This is my function that keeps the states in line with the values.

//--------------------------------------------------------------------
function updateGrid()
{
var list = this._parent._parent._parent;
trace("=====================================");
for(var id =0; id <list.length; id++)
{
var nr = 10 + id;
if(list.getItemAt(id)['Correct'] == true)
{
trace("true " + 'listRow' + nr);
list['content_mc']['listRow' + nr]['fCell0'].redBall._visible = false;
list['content_mc']['listRow' + nr]['fCell0'].greenBall._visible = true;
list['content_mc']['listRow' + nr]['fCell0'].correct.selected = true;
}
else
{
trace("false");
list['content_mc']['listRow' + nr]['fCell0'].redBall._visible = true;
list['content_mc']['listRow' + nr]['fCell0'].greenBall._visible = false;
list['content_mc']['listRow' + nr]['fCell0'].correct.selected = false;
}
}
}


Anyone have an idea what is the prob?

SrinivasSM
04-26-2005, 10:04 AM
Can't Understand Your code.Please Give full details like when i trace this "this._parent._parent._parent" what is the thing i get etc...else send me fla file so that i can help you out if possible.

remco-v
04-26-2005, 10:51 AM
Jup i mostly have the problem that peeps don't understand my work, i am to lazy to read up on how to properly do stuff soo i think up my own implementations. And who hoo is my brain in need of some defragmentation :D


This code is placed inside the cellrendere class.
I cant post the .fla since its 4mb in size :confused:


this._parent._parent._parent = a reference to the Datagrid object
list['content_mc']['listRow' + nr]['fCell0'] = a reference to the current cellrendere instance working on the cell in row marked by nr