View Full Version : checkBoxes(cellRenderers) in datagrids..
subba
07-24-2006, 05:44 PM
Hi,
I am using flash remoting and trying to set the data in a datagrid.After I get the data,I am adding a column name for checkboxes and i need those checkboxes to work. I am using the macromedia's cellRenderer classes -> CheckBoxCell.as from this site
http://www.adobe.com/support/documentation/en/flash/fl8/samples.html#component_samples
I just copied the CheckBoxCell component from the CellRendererers_sample.fla to my .fla. I am using the cell renderer like this.
my_datagrid.getColumnAt(0).cellRenderer = "CheckBoxCell";
if(my_datagrid.selectedItem.select != undefined)
trace("this is right");
else
trace("we shouldn't come here");
When i publish the fla file, I couldn't see the checkboxes in the datagrid and I am totally lost.Can somebody help me with this and correct me if i am doing something wrong.
Thanks,
Subba
acolyte
07-24-2006, 10:30 PM
Hi Scubba ,
take a look here :
http://www.flash-db.com/Tutorials/cellrenderer/
http://www.sephiroth.it/tutorials/flashPHP/cellRenderer/index.php
subba
07-24-2006, 11:05 PM
yup...I checked out that site and downloaded the files(source)...There is no CheckCellRenderer.as file.
I am using importing mx.controls.cells.CheckCellRenderer and tried to use it...but it is not working.I am not sure why it is not working
import mx.controls.cells.CheckCellRenderer;
var aData:Array = [
{Name:"Robert", Sign:"Cancer", Food:"Thai"},
{Name:"Harry", Sign:"Leo", Food:"italian"}
];
my_datagrid.dataProvider = aData;
my_datagrid.setSize(200,100);
my_datagrid.getColumnAt(0).cellRenderer = "CheckCellRenderer";
I am not sure why it is not working...Actually I want a new column which shows the checkboxes...but I am testing for now just to show checkboxes in any column...pleasee helpp.
Thanks,
Subba
acolyte
07-25-2006, 01:17 AM
Sry Subba ,
i dont want to sound anoying but this
http://www.adobe.com/support/documentation/en/flash/fl8/samples.html#component_samples
CheckBox and ComboBox CellRenderer example files providet @ the
Adobe Site works just fine here ?
I compiled with player 7 as 2.0 settings
does your Output shows any Errors while compiling or while spellchecking ?
greets Ac
subba
07-25-2006, 03:14 PM
I tried those examples in the begining....If you see my original post here, I was using the "CheckBoxCell" from the site and I downloaded CheckBoxCell.as and put in my folder and was using AS IS..As it didnt work, i tried to use the car-flash example and that didn't work too..
I am not getting any errors, but I am not able to see the checkBoxes in the datagrid..Is there something to do with the boolean values? ..Do i need to use labelFunction...I tried this also
my_datagrid.getColumnAt(0).cellRenderer = "CheckCellRenderer";
my_datagrid.getColumnAt(0).labelFunction = function(row:Object) { return true };
its not working yet...pls suggest something.
Thanks,
Subba
subba
07-25-2006, 03:22 PM
I tried like this to add a new column to an already populated datagrid(my_datagrid)
var column = new DataGridColumn("testing");
column.headerText = "Testing";
column.width = 80;
column.cellRenderer = "CheckBoxCell";
// tried the mx.controls.cells.CheckCellRenderer
// import mx.controls.cells.CheckCellRenderer;
// column.cellRenderer."CheckCellRenderer";
my_datagrid.addColumn(column);
Finally I want my cell renderer to work for this new columns as I want to add a new column with checkboxes and have the functionality related to other columns....its not working yet...
acolyte
07-25-2006, 03:50 PM
Hi Subba ,
i dont realy know what is going wrong @ your Enviroment ??!!??
just check if you have the >.< includet in your As 2.0 compiling classpaths , what force the Flashcompiler to include the classscripts in the directory where the Sourcefile are placed to be .
I just checked the example Yesterday night if it is working and i see the checkboxes
greets m@
subba
07-25-2006, 04:22 PM
those examples and samples are working for me also...I just downloaded all the files and the result is good...there is problem with only my flash file...I have my complete code actionscript file and I am linking my component to that actionscript file and then testing it.....so whatever i make changes(code),I am making them in the .as file and i have seperate .as file for cell renderer...I donno y it is not working for mee..
subba
07-25-2006, 04:53 PM
Hey Acolyte,
Thanks for your help...........stupid mistake and I fixed it.I had to drag the CheckBox component from the default components panel to my component library...and it works fine now.....i was trying whole day to solve this problem and coz of this silly problem.i couldn't get the checkboxes...its working fine now after the drag....tx for ur help...
Subba
acolyte
07-25-2006, 05:24 PM
yo Subba ,
glad you got it working now
Btw yesterday i came over a real jewelcase for CellRederers stuff :
http://philflash.inway.fr/index.html
greets m@
YoonMi
12-20-2006, 09:57 PM
I'm using the CheckBoxCell rendering component with a Datagrid. I'm getting my data from a SQL database everything seems to work fine, but they are all selected when I test my movie. I've tried to change my column in my database; first I tried true/false, then I tried yes/no --- nothing works they all just show up selected. What could I be doing wrong?
Thanks,
YoonMi
soggybag
04-19-2007, 01:18 AM
I have tried the CheckCellRenderer.as and it works to put the CheckBox into a cell.
I have set the dataProvider of my DataGrid to an array. How do I get the value of the CheckBox to change the correct value of the dataProvider?
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.