Thanks for the reply Tracy

 

You suggest finding a different solution. I have included a screenshot here
http://www.mediakitchen.co.uk/mark_sheet.jpg to illustrate what I am trying
to achieve.

 

Can you or anyone suggest what sort of component is best suited to represent
this data structure?

 

Thanks

 

Paul

 

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: 24 August 2007 12:04
To: [email protected]
Subject: [SPAM] RE: [flexcoders] Display item renderer in only some rows of
a datagrid

 

You are attempting something the datagrid is not designed for.  Renderers
are column based and will apply to every row.  You could probably make the
renderer show a combobox in every 5 the row using a collection as the
dataProvider, being sure to implement IdropInListItemRenderer to have access
to listData, and using getItemIndex() with the modulus operator.

 

But then you have the data issue.  An interactive renderer should update the
dataProvider item property, and should set its state based on that property,
in the set data() method.  How that would work with a combobox in every 5th
row I can't imagine.

 

You might be able to use some data structure that is external to the
datagrid to support this.

 

It is an interesting problem, but I'd consider trying to find a different
solution.

 

Tracy

 

 

 

  _____  

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul Steven
Sent: Friday, August 24, 2007 2:59 AM
To: [email protected]
Subject: [flexcoders] Display item renderer in only some rows of a datagrid

 

I need to display a combobox item renderer in my datagrid only in the first
of every 5 rows. With the remaining 4 rows in this particular column empty.
Then the pattern will repeat again.

 

This is how I am currently creating the columns however with this approach
the combobox itemrenderer is appearing in all rows

 

<mx:columns>

                <mx:DataGridColumn headerText="No."
dataField="assCriteriaNum" width="60" />

                <mx:DataGridColumn headerText="Assessment Criteria"
dataField="assCriteria" width="210"/>

                <mx:DataGridColumn headerText="Mark Range"
dataField="markRange" width="50" />

                <mx:DataGridColumn headerText="Mark" dataField="mark"
width="70" >

                <mx:itemRenderer>

                                <mx:Component>

                                                <mx:ComboBox>

 
<mx:dataProvider>

 
<mx:ArrayCollection>

 
<mx:String>0</mx:String>

 
<mx:String>1</mx:String>

 
<mx:String>2</mx:String>

 
<mx:String>3</mx:String>

 
<mx:String>4</mx:String>

 
<mx:String>5</mx:String>

 
<mx:String>6</mx:String>

 
<mx:String>7</mx:String>

 
<mx:String>8</mx:String>

 
<mx:String>9</mx:String>

 
<mx:String>10</mx:String>

 
</mx:ArrayCollection>

 
</mx:dataProvider>

                                                </mx:ComboBox> 

 


                                </mx:Component>

                </mx:itemRenderer>

                </mx:DataGridColumn>

 


</mx:columns>

 

 

 

Reply via email to