You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Oleg Konovalov <ol...@gmail.com> on 2014/02/04 13:49:50 UTC

Rendering components in MX DataGrid

Hi,



I have tried to add Spark Dropdown, MX Checkbox and a Button in MX DataGrid

(as FX Component in itemRenderer). Neither of them had any data, I just
needed to see them displayed,

but none of them displayed. Why?

Each of them displayed fine outside of DataGrid

Am I missing something?



Using Flex 4.5.1.





TIA,

Oleg.

Re: Rendering components in MX DataGrid

Posted by Oleg Konovalov <ol...@gmail.com>.
I meant I can not use Spark DataGrid, only Flex3 DG or ADG for consistency.
But I use some Flex4 components (DropDownList, etc).

So is it possible to put DDL inside Flex3 DataGrid?

And is it legitimate to expect to see that DDL or ComboBox on the screen
(even not populated) if myDG.dataProvider is null?


Thank you in advance,
Oleg


On Sun, Feb 9, 2014 at 10:14 PM, Michael A. Labriola <
labriola@digitalprimates.net> wrote:

> >>That pattern works for mx components in MX DataGrid, but Spark
> components do not "drop-in" as item renderers.
>
> >Oleg says he is using mx components only.
>
> >"(we use Flex3 MX and datagrids/ADGs throughout that app, so switching to
> Flex4 DGs/ADGs is not an option)."
>
> "Now I am able to render CheckBox and Button in MX DataGrid, but still
> can't use Spark DropDownList (or MX ComboBox)  inside DataGrid,"
>
> I am pretty sure that's what Alex is referring to...
>
> Mike
>
>


-- 
Thank you,
Oleg.

RE: Rendering components in MX DataGrid

Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
>>That pattern works for mx components in MX DataGrid, but Spark components do not "drop-in" as item renderers.

>Oleg says he is using mx components only.

>"(we use Flex3 MX and datagrids/ADGs throughout that app, so switching to Flex4 DGs/ADGs is not an option)."

"Now I am able to render CheckBox and Button in MX DataGrid, but still can't use Spark DropDownList (or MX ComboBox)  inside DataGrid,"

I am pretty sure that's what Alex is referring to...

Mike


RE: Rendering components in MX DataGrid

Posted by Maurice Amsellem <ma...@systar.com>.
>That pattern works for mx components in MX DataGrid, but Spark components do not "drop-in" as item renderers.

Oleg says he is using mx components only.

"(we use Flex3 MX and datagrids/ADGs throughout that app,
so switching to Flex4 DGs/ADGs is not an option).
"

Maurice

-----Message d'origine-----
De : Alex Harui [mailto:aharui@adobe.com] 
Envoyé : vendredi 7 février 2014 18:14
À : dev@flex.apache.org
Objet : Re: Rendering components in MX DataGrid

That pattern works for mx components in MX DataGrid, but Spark components do not "drop-in" as item renderers.

I'm not sure if it is easier to subclass DDL and implement IListItemRenderer or subclass mx:ComboBox and disable editing in the TextInput.

-Alex

On 2/7/14 5:12 AM, "Maurice Amsellem" <ma...@systar.com> wrote:

>Hi ,
>
>I am using mx:DataGrid with mx:ComboBox cell renderer with no issue.
>
>The way I do that is throught DataGridColumn itemRenderer.
>
>The way you populate the DDL is through the itemRenderer "data" 
>variable, where data is the object for the rendered row.
>
>So it could be something like:
>
><mx:DataGrid ...>
>   <mx:columns>
>          <mx:DataGridColumn  >
>                    <itemRenderer>
>                       <fx:Component>
>                             <mx:ComboBox 
>dataProvider="{data.someValues}"/>
>                      </fx:Component>
> ....
>
>HTH
>
>Maurice
>
>-----Message d'origine-----
>De : Oleg Konovalov [mailto:olegkon@gmail.com] Envoyé : vendredi 7 
>février 2014 13:34 À : dev@flex.apache.org Objet : Re: Rendering 
>components in MX DataGrid
>
>Hi,
>
>
>
>Now I am able to render CheckBox and Button in MX DataGrid,
>
>but still can't use Spark DropDownList (or MX ComboBox)  inside 
>DataGrid,
>
>and it¹s not working ­ DDL doesn¹t show up and cannot populate it.
>
>
>
>Here is my scenario:
>
>User Selects a Version from another DropDownList outside DataGrid on 
>the same form,
>
>we capture that Version, and call Stored Proc with that version via Web 
>Service,
>
>It returns us data which we need to populate inside these DropDown¹s.
>
>
>
>So far I cannot make these components to show inside DataGrid.
>
>In fact, as soon as I try to put them in the DataGrid (as itemRenderer 
>with Component),
>
>It freezes that Version DropDownList, so no more Selection of Version 
>is possible.
>
>
>
>I found a few examples on the net where all that is done with 
>DropDownList in Spark DataGrid,
>
>but it doesn¹t seem to work in Flex3 ComboBox (and I can¹t give ID to 
>that component inside DataGridColumn,
>
>so I can¹t manipulate it from outside.
>
>
>
>Any idea how to do that with Flex3 DataGrid?
>
>(we use Flex3 MX and datagrids/ADGs throughout that app,
>
>so switching to Flex4 DGs/ADGs is not an option).
>
>
>
>
>Please help!
>
>
>
>TIA,
>
>Oleg
>
>
>On Tue, Feb 4, 2014 at 8:03 AM, Christofer Dutz
><ch...@c-ware.de>wrote:
>
>> Well please correct me if I'm on the wrong path, but if you have your 
>> compoenents inside an Item Renderer, but don't have a single item to 
>> render in the Container that uses this, then Flex doesn't Show a 
>> single one of them. In order to have your itemrenderer used, you have 
>> to provide your data Container with at least one element to make it 
>> actually Display anything.
>>
>> Chris
>> ________________________________________
>> Von: Oleg Konovalov <ol...@gmail.com>
>> Gesendet: Dienstag, 4. Februar 2014 13:49
>> An: flex-dev@apache.org
>> Betreff: Rendering components in MX DataGrid
>>
>> Hi,
>>
>>
>>
>> I have tried to add Spark Dropdown, MX Checkbox and a Button in MX 
>> DataGrid
>>
>> (as FX Component in itemRenderer). Neither of them had any data, I 
>> just needed to see them displayed,
>>
>> but none of them displayed. Why?
>>
>> Each of them displayed fine outside of DataGrid
>>
>> Am I missing something?
>>
>>
>>
>> Using Flex 4.5.1.
>>
>>
>>
>>
>>
>> TIA,
>>
>> Oleg.
>>
>
>
>
>--
>Thank you,
>Oleg.


Re: Rendering components in MX DataGrid

Posted by Alex Harui <ah...@adobe.com>.
That pattern works for mx components in MX DataGrid, but Spark components
do not "drop-in" as item renderers.

I'm not sure if it is easier to subclass DDL and implement
IListItemRenderer or subclass mx:ComboBox and disable editing in the
TextInput.

-Alex

On 2/7/14 5:12 AM, "Maurice Amsellem" <ma...@systar.com> wrote:

>Hi ,
>
>I am using mx:DataGrid with mx:ComboBox cell renderer with no issue.
>
>The way I do that is throught DataGridColumn itemRenderer.
>
>The way you populate the DDL is through the itemRenderer "data" variable,
>where data is the object for the rendered row.
>
>So it could be something like:
>
><mx:DataGrid ...>
>   <mx:columns>
>          <mx:DataGridColumn  >
>                    <itemRenderer>
>                       <fx:Component>
>                             <mx:ComboBox
>dataProvider="{data.someValues}"/>
>                      </fx:Component>
> ....
>
>HTH
>
>Maurice 
>
>-----Message d'origine-----
>De : Oleg Konovalov [mailto:olegkon@gmail.com]
>Envoyé : vendredi 7 février 2014 13:34
>À : dev@flex.apache.org
>Objet : Re: Rendering components in MX DataGrid
>
>Hi,
>
>
>
>Now I am able to render CheckBox and Button in MX DataGrid,
>
>but still can't use Spark DropDownList (or MX ComboBox)  inside DataGrid,
>
>and it¹s not working ­ DDL doesn¹t show up and cannot populate it.
>
>
>
>Here is my scenario:
>
>User Selects a Version from another DropDownList outside DataGrid on the
>same form,
>
>we capture that Version, and call Stored Proc with that version via Web
>Service,
>
>It returns us data which we need to populate inside these DropDown¹s.
>
>
>
>So far I cannot make these components to show inside DataGrid.
>
>In fact, as soon as I try to put them in the DataGrid (as itemRenderer
>with Component),
>
>It freezes that Version DropDownList, so no more Selection of Version is
>possible.
>
>
>
>I found a few examples on the net where all that is done with
>DropDownList in Spark DataGrid,
>
>but it doesn¹t seem to work in Flex3 ComboBox (and I can¹t give ID to
>that component inside DataGridColumn,
>
>so I can¹t manipulate it from outside.
>
>
>
>Any idea how to do that with Flex3 DataGrid?
>
>(we use Flex3 MX and datagrids/ADGs throughout that app,
>
>so switching to Flex4 DGs/ADGs is not an option).
>
>
>
>
>Please help!
>
>
>
>TIA,
>
>Oleg
>
>
>On Tue, Feb 4, 2014 at 8:03 AM, Christofer Dutz
><ch...@c-ware.de>wrote:
>
>> Well please correct me if I'm on the wrong path, but if you have your
>> compoenents inside an Item Renderer, but don't have a single item to
>> render in the Container that uses this, then Flex doesn't Show a
>> single one of them. In order to have your itemrenderer used, you have
>> to provide your data Container with at least one element to make it
>> actually Display anything.
>>
>> Chris
>> ________________________________________
>> Von: Oleg Konovalov <ol...@gmail.com>
>> Gesendet: Dienstag, 4. Februar 2014 13:49
>> An: flex-dev@apache.org
>> Betreff: Rendering components in MX DataGrid
>>
>> Hi,
>>
>>
>>
>> I have tried to add Spark Dropdown, MX Checkbox and a Button in MX
>> DataGrid
>>
>> (as FX Component in itemRenderer). Neither of them had any data, I
>> just needed to see them displayed,
>>
>> but none of them displayed. Why?
>>
>> Each of them displayed fine outside of DataGrid
>>
>> Am I missing something?
>>
>>
>>
>> Using Flex 4.5.1.
>>
>>
>>
>>
>>
>> TIA,
>>
>> Oleg.
>>
>
>
>
>--
>Thank you,
>Oleg.


RE: Rendering components in MX DataGrid

Posted by Maurice Amsellem <ma...@systar.com>.
Hi ,

I am using mx:DataGrid with mx:ComboBox cell renderer with no issue.

The way I do that is throught DataGridColumn itemRenderer.

The way you populate the DDL is through the itemRenderer "data" variable, where data is the object for the rendered row.

So it could be something like:

<mx:DataGrid ...>
   <mx:columns>
          <mx:DataGridColumn  >
                    <itemRenderer>
                       <fx:Component>
                             <mx:ComboBox dataProvider="{data.someValues}"/>
                      </fx:Component>
 ....

HTH

Maurice 

-----Message d'origine-----
De : Oleg Konovalov [mailto:olegkon@gmail.com] 
Envoyé : vendredi 7 février 2014 13:34
À : dev@flex.apache.org
Objet : Re: Rendering components in MX DataGrid

Hi,



Now I am able to render CheckBox and Button in MX DataGrid,

but still can't use Spark DropDownList (or MX ComboBox)  inside DataGrid,

and it’s not working – DDL doesn’t show up and cannot populate it.



Here is my scenario:

User Selects a Version from another DropDownList outside DataGrid on the same form,

we capture that Version, and call Stored Proc with that version via Web Service,

It returns us data which we need to populate inside these DropDown’s.



So far I cannot make these components to show inside DataGrid.

In fact, as soon as I try to put them in the DataGrid (as itemRenderer with Component),

It freezes that Version DropDownList, so no more Selection of Version is possible.



I found a few examples on the net where all that is done with DropDownList in Spark DataGrid,

but it doesn’t seem to work in Flex3 ComboBox (and I can’t give ID to that component inside DataGridColumn,

so I can’t manipulate it from outside.



Any idea how to do that with Flex3 DataGrid?

(we use Flex3 MX and datagrids/ADGs throughout that app,

so switching to Flex4 DGs/ADGs is not an option).




Please help!



TIA,

Oleg


On Tue, Feb 4, 2014 at 8:03 AM, Christofer Dutz
<ch...@c-ware.de>wrote:

> Well please correct me if I'm on the wrong path, but if you have your 
> compoenents inside an Item Renderer, but don't have a single item to 
> render in the Container that uses this, then Flex doesn't Show a 
> single one of them. In order to have your itemrenderer used, you have 
> to provide your data Container with at least one element to make it 
> actually Display anything.
>
> Chris
> ________________________________________
> Von: Oleg Konovalov <ol...@gmail.com>
> Gesendet: Dienstag, 4. Februar 2014 13:49
> An: flex-dev@apache.org
> Betreff: Rendering components in MX DataGrid
>
> Hi,
>
>
>
> I have tried to add Spark Dropdown, MX Checkbox and a Button in MX 
> DataGrid
>
> (as FX Component in itemRenderer). Neither of them had any data, I 
> just needed to see them displayed,
>
> but none of them displayed. Why?
>
> Each of them displayed fine outside of DataGrid
>
> Am I missing something?
>
>
>
> Using Flex 4.5.1.
>
>
>
>
>
> TIA,
>
> Oleg.
>



--
Thank you,
Oleg.

Re: Rendering components in MX DataGrid

Posted by Oleg Konovalov <ol...@gmail.com>.
Hi,



Now I am able to render CheckBox and Button in MX DataGrid,

but still can't use Spark DropDownList (or MX ComboBox)  inside DataGrid,

and it’s not working – DDL doesn’t show up and cannot populate it.



Here is my scenario:

User Selects a Version from another DropDownList outside DataGrid on the
same form,

we capture that Version, and call Stored Proc with that version via Web
Service,

It returns us data which we need to populate inside these DropDown’s.



So far I cannot make these components to show inside DataGrid.

In fact, as soon as I try to put them in the DataGrid (as itemRenderer with
Component),

It freezes that Version DropDownList, so no more Selection of Version is
possible.



I found a few examples on the net where all that is done with DropDownList
in Spark DataGrid,

but it doesn’t seem to work in Flex3 ComboBox (and I can’t give ID to that
component inside DataGridColumn,

so I can’t manipulate it from outside.



Any idea how to do that with Flex3 DataGrid?

(we use Flex3 MX and datagrids/ADGs throughout that app,

so switching to Flex4 DGs/ADGs is not an option).




Please help!



TIA,

Oleg


On Tue, Feb 4, 2014 at 8:03 AM, Christofer Dutz
<ch...@c-ware.de>wrote:

> Well please correct me if I'm on the wrong path,
> but if you have your compoenents inside an Item Renderer, but don't have a
> single item to render in the Container that uses this, then Flex doesn't
> Show a single one of them. In order to have your itemrenderer used, you
> have to provide your data Container with at least one element to make it
> actually Display anything.
>
> Chris
> ________________________________________
> Von: Oleg Konovalov <ol...@gmail.com>
> Gesendet: Dienstag, 4. Februar 2014 13:49
> An: flex-dev@apache.org
> Betreff: Rendering components in MX DataGrid
>
> Hi,
>
>
>
> I have tried to add Spark Dropdown, MX Checkbox and a Button in MX DataGrid
>
> (as FX Component in itemRenderer). Neither of them had any data, I just
> needed to see them displayed,
>
> but none of them displayed. Why?
>
> Each of them displayed fine outside of DataGrid
>
> Am I missing something?
>
>
>
> Using Flex 4.5.1.
>
>
>
>
>
> TIA,
>
> Oleg.
>



-- 
Thank you,
Oleg.

AW: Rendering components in MX DataGrid

Posted by Christofer Dutz <ch...@c-ware.de>.
Well please correct me if I'm on the wrong path, 
but if you have your compoenents inside an Item Renderer, but don't have a single item to render in the Container that uses this, then Flex doesn't Show a single one of them. In order to have your itemrenderer used, you have to provide your data Container with at least one element to make it actually Display anything.

Chris
________________________________________
Von: Oleg Konovalov <ol...@gmail.com>
Gesendet: Dienstag, 4. Februar 2014 13:49
An: flex-dev@apache.org
Betreff: Rendering components in MX DataGrid

Hi,



I have tried to add Spark Dropdown, MX Checkbox and a Button in MX DataGrid

(as FX Component in itemRenderer). Neither of them had any data, I just
needed to see them displayed,

but none of them displayed. Why?

Each of them displayed fine outside of DataGrid

Am I missing something?



Using Flex 4.5.1.





TIA,

Oleg.

Re: Rendering components in MX DataGrid

Posted by Samuel Facchinello <sa...@gmail.com>.
Hi.

Try this:


<mx:AdvancedDataGridColumn dataField="check"
   headerText="Check"
   minWidth="30">
<mx:itemRenderer>
<fx:Component>
 <mx:HBox width="100%"
 horizontalAlign="center">
<fx:Script>
 <![CDATA[
protected function check_changeHandler(event:Event):void {
outerDocument.controller.functionTest(event);
 }
 override public function set data(value:Object):void {
 super.data = value;
}
]]>
 </fx:Script>
 <mx:CheckBox change="check_changeHandler(event)"
 selected="{data.check}"/>
</mx:HBox>
</fx:Component>
 </mx:itemRenderer>
</mx:AdvancedDataGridColumn>




Att,
Samuel Facchinello
http://desenvolvendoemflex.blogspot.com
Joinville - SC


2014-02-04 Oleg Konovalov <ol...@gmail.com>:

> Hi,
>
>
>
> I have tried to add Spark Dropdown, MX Checkbox and a Button in MX DataGrid
>
> (as FX Component in itemRenderer). Neither of them had any data, I just
> needed to see them displayed,
>
> but none of them displayed. Why?
>
> Each of them displayed fine outside of DataGrid
>
> Am I missing something?
>
>
>
> Using Flex 4.5.1.
>
>
>
>
>
> TIA,
>
> Oleg.
>