|
I am *super*
close to getting this, but I’m stuck on one thing. If I click the checkbox (custom
cellrenderer), I dispatch an event which changing the value in my dataProvider
by using selectedIndex. But I need to have set “selectable=false”
for the dataProvider, so I need to somehow know what row the checkbox is in
without using selectedIndex. Anything in the dataObject which says
which row you’re on? _________________________________________ Jonathan Miranda Flexible Master of the Web "In the
game of chess, it's important to never let your opponent see your pieces." From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf
Of Jonathan Miranda Once again Jester, awesome help….but
I’m in Flex2 Beta ;) _________________________________________ Jonathan Miranda Flexible Master of the Web "In the
game of chess, it's important to never let your opponent see your pieces." From:
[email protected] [mailto:[EMAIL PROTECTED] On Behalf Of JesterXL setValue in 1.5 actually sends you the selected state of the
row. You can thus do: if ( selected != "selected") { yourCH.selected = false; } else { yourCH.selected = true; } And, in your cellRenderer, you can access the grid via
listOwner property. yourCH.addEventListener("click",
Delegate.create(this, onClick)); function click() { if(yourCH.selected == false) return; var a:Array
= listOwner.selectedIndices; if(a == null) a = []; a.push(getCellIndex().itemIndex); } ----- Original Message ----- From: Jonathan
Miranda Sent: Friday, February
10, 2006 11:40 AM Subject: [flexcoders] How
to handle this DataGrid request I’ve a tricky job with a datagrid request from an
employer and wondering how I should tackle this. They want a datagrid that can
do multiple selections by a checkbox in a row – not your normal
shift-click. So you click on 3 checkboxes for 3 rows, and all 3 get selected. How can I bind the checkbox click to the datagrid
selectedIndices – is there an easy way to reference the datagrid through
the cellrenderer dataObject? Having a hard enough time getting the checkbox to
correctly sort and be remembered. I’m considering trying to
“cheat” and make it so when you click anywhere in the row, it
selects that row and checks/unchecks the checkbox – but even this is
stumping me how I can bind the cell-renderer checkbox to the selectedindices
array or something similar. I’ve actually ran this by and they’re
fine with that, so how can I bind selecting a row in a datagrid to checking
that row’s checkbox…and allowing normal clicks toggle what’s
selected (not shift-click). _________________________________________ Jonathan Miranda Flexible Master of
the Web "In the game of
chess, it's important to never let your opponent see your pieces."
|
- RE: [flexcoders] How to handle this DataGrid request Jonathan Miranda
- Re: [flexcoders] How to handle this DataGrid request JesterXL
- RE: [flexcoders] How to handle this DataGrid request Jonathan Miranda
- RE: [flexcoders] How to handle this DataGrid request Jonathan Miranda
- Re: [flexcoders] How to handle this DataGrid req... Manish Jethani

