[flexcoders] Create border for inner subgrids within a grid - How?

2008-06-27 Thread pbrendanc
Another noob question - I've created a dynamic (n*n) grid and need to
provide some visual delineation of the inner grids - e.g. a 4*4 grid
contains 4 inner 2*2 subgrids.

How can I create a border around each of these subgrids?  (This  will
also need to be done dynamically).

TIA,
Patrick

FWIW - The grid is built with the following function

private function buildGrid (nrows:uint,ncols:uint):void {

 for (var i:Number = 0; inrows; i++) {
 var myGridRow:GridRow =  new GridRow();
 // for each col add child controls
 for (var j:Number = 0; jncols; j++) {
 var myGridItem:GridItem =  new GridItem();
 myGridItem.addChild (myBtn);
 //Add cell to row
 myGridRow.addChild (myGridItem);
 }// end col loop

 // Add row to grid
 myGrid.addChild(myGridRow);
 }
 // Add grid to parent container (canvas/form/panel
etc??)
 mypanel.addChild(myGrid);
}





RE: [flexcoders] Create border for inner subgrids within a grid - How?

2008-06-27 Thread Alex Harui
myGridItem.setStyle(borderStyle, solid)

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of pbrendanc
Sent: Friday, June 27, 2008 2:50 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Create border for inner subgrids within a grid -
How?

 

Another noob question - I've created a dynamic (n*n) grid and need to
provide some visual delineation of the inner grids - e.g. a 4*4 grid
contains 4 inner 2*2 subgrids.

How can I create a border around each of these subgrids? (This will
also need to be done dynamically).

TIA,
Patrick

FWIW - The grid is built with the following function

private function buildGrid (nrows:uint,ncols:uint):void {

for (var i:Number = 0; inrows; i++) {
var myGridRow:GridRow = new GridRow();
// for each col add child controls
for (var j:Number = 0; jncols; j++) {
var myGridItem:GridItem = new GridItem();
myGridItem.addChild (myBtn);
//Add cell to row
myGridRow.addChild (myGridItem);
} // end col loop

// Add row to grid
myGrid.addChild(myGridRow);
}
// Add grid to parent container (canvas/form/panel
etc??)
mypanel.addChild(myGrid);
}