flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Baird <mba...@kairyt.com>
Subject Re: Spark DataGrid with combobox
Date Mon, 22 Jul 2013 22:51:54 GMT
If you don't clear the provider as Lee suggests, you could also set the
selected index to -1 or whatever your default option is.

If you're extending GridItemRenderer, it's recommended to also use override
*prepare()* instead of *set data* for performance reasons.


On Mon, Jul 22, 2013 at 3:43 PM, Lee Burrows
<subscriptions@leeburrows.com>wrote:

> could the issue be related to not clearing your renderer of its previous
> values when data=null?
>
> eg:
>
> if (data)
>    //your code
> else
>     answer.dataProvider = null;
>
>
>
>
> On 22/07/2013 22:25, mark goldin wrote:
>
>> I have a column with combobox as an item renderer. The combo has a simple
>> dataProvider like Yes, No. When I scroll the grid values in combos are
>> changing. Here is relative code from my renderer, simplified:
>> override public function set data(value:Object):void
>> {
>> super.data = value;
>> if (data)
>> {
>> answer.dataProvider = externaldataprovider;
>>
>> for (var i:Number = 0; i < answer.dataProvider.length; i++)
>> {
>> var obj:Object = Object(answer.dataProvider[i])
>> if (obj["CodeValue"] == data.Answer)
>> {
>> answer.selectedIndex = i;
>> break;
>> }
>> }
>> }
>> }
>> }
>>
>> Thanks
>>
>>
>
> --
> Lee Burrows
> ActionScripter
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message