Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Using a checkcellrenderer with the results returned from remoting

Using a checkcellrenderer with the results returned from remoting

2004-03-03       - By Collin Peters

 Back
I am having a very frustrating problem.  I have a database query that
returns some simple text fields and populates a DataGrid (in Flash
2004).  This part all works fine.  I have added a CheckCellRenderer as
the first column in the grid.  The problem is that the checkbox in the
cell doesn't work properly with the results from the server.  Here is my
onResult responder:

var secondResult = new Object();
secondResult.onResult = function(result_rs) {
  // The following line binds the recordset to the grid
  templates_dg.dataProvider = result_rs;
}

This code properly fills in the datagrid.  However, whenever I try to
check the checkbox in the first column, it immediately resets it to
whatever it's initial value was.  This renders the checkbox completely
useless.

I have created this as a workaround which does work:

var secondResult = new Object();
secondResult.onResult = function(result_rs) {
  var arr = new Array();
  for (var i = 0; i < result_rs.length; i++) {
    var obj= result_rs.getItemAt(i);

    arr.push({sel:false, template_id:obj["template_id"], name:obj["name"],
objective:obj["objective"], description:obj["objective"]});
  }
   
  templates_dg.dataProvider = arr;
}

This just recreates the data in a new array.  When I do it this way I
can use the checkbox as intended.  Does anybody know why the results_rs
parameter from the onResult function would not allow me to use the checkbox?

Collin

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Supported by Fig Leaf Software
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Lower Prices for Certified Training! Check out new lower prices for
Certified Macromedia Training from Fig Leaf Software. Expand your
skill set with courses in ColdFusion, Flash, Rich Internet
Applications and .NET in the new year.  Fig Leaf Software provides
the highest caliber instruction at our training centers in Washington  
D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at
your location.

Get the details at http://training.figleaf.com/
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: flashcomm-unsubscribe@(protected)
For additional commands, e-mail: flashcomm-help@(protected)