That worked, thanks very much!

Iain

--- In [email protected], "Doug Lowder" <[EMAIL PROTECTED]> wrote:
>
> I guess you could go straight to the dataProvider and instead of 
> listOwner.editField() use:
> 
> listOwner.dataProvider[getCellIndex().itemIndex].stepper = val;
> 
> 
> --- In [email protected], "digital_eyezed" 
> <iain.mclean@> wrote:
> >
> > Thanks,
> > 
> > I tried this, but the numericStepper just stops stepping.
> > 
> > Any other ideas?
> > 
> > CHeers,
> > 
> > Iain
> > 
> > New Renderer code:
> > 
> > <mx:HBox horizontalAlign="center" width="100%"
> > xmlns:mx="http://www.macromedia.com/2003/mxml";>
> > <mx:Script>
> > <![CDATA[
> >     var labelData:Object;
> >     var val;
> >     var listOwner : MovieClip;
> >         var getCellIndex : Function;
> >         var getDataLabel : Function;
> > 
> >     function setValue(str:String, item:Object) {
> >             if (item == undefined){
> >          visible = false;
> >          return;
> >             }
> >             visible = true;
> >             var s = item;
> >             labelData = s;
> >             val = labelData.stepper;
> >     }
> > 
> >     function changeVal(){
> >             val = changed.value;
> >             listOwner.editField(getCellIndex().itemIndex, 
> getDataLabel(), val);
> >     }
> > ]]>
> > </mx:Script>
> > <mx:NumericStepper id="changed" value="{val}" change="changeVal()" 
> > maximum="{labelData.fill}"/>
> > </mx:HBox>
> > 
> > --- In [email protected], "Doug Lowder" <douglowder@> 
> wrote:
> > >
> > > 
> > > Hi Iain,
> > > 
> > > You need to update the grid's data field in your change 
> handler.  Try
> > > the following:
> > > 
> > >    var listOwner : MovieClip; // the reference we receive to the 
> list
> > > 
> > >    var getCellIndex : Function; // the function we receive from 
> the list
> > > 
> > >    var getDataLabel : Function; // the function we receive from 
> the list
> > > 
> > >    function changeVal() {
> > > 
> > >        val = changed.value;
> > > 
> > >        listOwner.editField(getCellIndex().itemIndex, getDataLabel
> (),
> > > val);
> > > 
> > >    }
> > > 
> > > 
> > > 
> > > Relevant links:
> > > 
> > > 
> http://weblogs.macromedia.com/pent/archives/2004/12/cell_renderers.cf
> m
> > > 
> <http://weblogs.macromedia.com/pent/archives/2004/12/cell_renderers.c
> fm>
> > > 
> > >
> > 
> http://weblogs.macromedia.com/pent/archives/flex/solutions/cellrender
> ers\
> > > .zip
> > >
> > 
> <http://weblogs.macromedia.com/pent/archives/flex/solutions/cellrende
> rer\
> > > s.zip>  (source)
> > > 
> > > 
> > > 
> > > --- In [email protected], "digital_eyezed" 
> <iain.mclean@>
> > > wrote:
> > > >
> > > > Hi all,
> > > >
> > > > I have a problem with a numeric stepper in a cellrenderer of a
> > > > dataGridColumn.
> > > >
> > > > When the cell loses focus, it goes back to the value set 
> initially, so
> > > > I lose all the changes.
> > > >
> > > > Here is the cellrenderer code:
> > > >
> > > > <mx:HBox horizontalAlign="center" width="100%"
> > > > xmlns:mx="http://www.macromedia.com/2003/mxml";>
> > > > <mx:Script>
> > > > <![CDATA[
> > > >
> > > > var labelData:Object;
> > > > var val;
> > > >
> > > > function setValue(str:String, item:Object) {
> > > > if (item == undefined){
> > > > visible = false;
> > > > return;
> > > > }
> > > > visible = true;
> > > > var s = item;
> > > > labelData = s;
> > > > val = labelData.levels;
> > > > }
> > > > function changeVal(){
> > > > val = changed.value;
> > > > }
> > > > ]]>
> > > > </mx:Script>
> > > > <mx:NumericStepper id="changed" value="{val}" change="changeVal
> ()"
> > > > maximum="{labelData.fill}"/>
> > > > </mx:HBox>
> > > >
> > > > I need the numericStepper to keep the value I change it to in 
> each of
> > > > the rows I change it.
> > > >
> > > > Cheers,
> > > >
> > > > Iain
> > > >
> > >
> >
>


Reply via email to