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)
|
|