开发者

as3 flash multiple checkboxes get selected on single click

i have datagrid filling from mysql successfully.But when i click on a checkbox AND scroll down, i found one more checkbox selectd. Even the same number of extra checkboxes are get selected that i select manually. for example if i select 10 checkboxes and scroll down there will be 10 more chekboxes selected. STRANGE :(

Any help with my code will be appreciated very much!

I used the bellow cellrender class for checkbox to show in datagrid.

http://www.actionscript.org/forums/showthread.php3?t=234416

here is my code.

for (varName in returnObj) {
var plid                = int   (returnObj[varName]["plid"]);
var varState            = Str开发者_JAVA百科ing(returnObj[varName]["state"]);
var varCity             = String(returnObj[varName]["city"]); 

 arrDP.push({        //arrDP is array defined
  //Column          Value
  Select          : plid, 
  State           : varState,
  City            : varCity
});


var select:DataGridColumn        = dg.addColumn("Select");
var state :DataGridColumn        = dg.addColumn("State");
var city  :DataGridColumn        = dg.addColumn("City");    
dg.dataProvider                  = dp; //dg IS DATAGRID NAME AND dp IS DATAPROVIDER
select.cellRenderer              = ButtonRenderer; // ButtonRenderer is a class for rendering CHECKBOX
var dp:DataProvider              = new DataProvider(arrDP);
} 


I took a quick peek at that link, and if you read carefully the source code provided at that page is actually broken code, that the author is complaining does not work. The issue seems to go unresolved.

You are probably correctly using a broken object.

Try this implementation.

Looks a lot cleaner (and actually commented).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜