Hi, You could also add an extra row at the top with something like
this:
teams.source.unshift("FRANCHNAME:'All Teams'","FRANCHID:'All'");
-TH
--- In [email protected], "Doug Lowder" <[EMAIL PROTECTED]>
wrote:
>
> The addItemAt() function takes an object as the first parameter,
not
> an array of objects. So you'd want:
>
> teams.addItemAt( {FRANCHNAME:'All Teams',FRANCHID:'All'} , 0);
>
> As Oscar states, there's a prompt property of ComboBox you can use
> to add that extra row.
>
> --- In [email protected], "yaagcur" <agcur@> wrote:
> >
> > I return a recordset and create a new arraycollection just fine
> > but wish to add an extra row at the top . The following just
> produces an
> > [object, Object] result in the combo box I populate for the
> additional
> > entry
> >
> >
> > public function myFunction(event:ResultEvent):void {
> > trace ("results returned");
> > teams = new
> > ArrayCollection(mx.utils.ArrayUtil.toArray
(event.result.source));
> > teams.addItemAt([{FRANCHNAME:'All
> Teams',FRANCHID:'All'}],0); //
> > FRANCHNAME and FRANCHID are the two properties in the object
> > teams.refresh();
> > }
> > I would also like the combobox to show the new All teams as
default
> > in the combobox
> >
> > cheers
> >
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/