Cara, se o datagrid está sendo carregado com os objetos o problema deve
estar no "coluns.addItem(descricao.selectedItem);".

Você tentou fazer um teste de passar o objeto para o back-end da aplicação
para ver se seu additem realmente está funcionando?

Uma outrsa coisa, a um tempo atras tinha que adicionar alguns ítens a um
determinado objeto. O pessoal aqui da lista me orientou a não criar uma
lista e depois persistir o objeto, poque dessa forma se você tiver várias
pessoas utilizando a aplicação poderá ter dados inconsistentes. Então dessa
forma se você puder perssistir cada ítem que deverá ser adicionado ou
removido acredito ser mais confiável, é claro que a aplicação perde um pouco
da velocidade mais acredito não ser muito diferente.

Em 16 de junho de 2011 11:12, Principe borodin
<[email protected]>escreveu:

> nao, eu consegui fazer isso, mas na hora que passo para o segundo
> datagrid, e tento pegar todos os itens desse segundo datagrid eu nao
> consigo...
>
> On 16 jun, 07:56, Re JMD <[email protected]> wrote:
> > Segue como faço meu advanced datagrid:
> >
> > //se não registrar esse as os dados que tem relacionamento não aparece no
> > datagrtid.
> > registerClassAlias(*"com.xx.xx.vo.Debito"*, Debito);
> >
> > <mx:AdvancedDataGrid x="0" y="51" id="adgMovimento" width="100%"
> height="446"
> > initialize="gc.refresh();">
> >
> > <mx:dataProvider>
> >
> > <mx:GroupingCollection2 id="gc" source="{debito}">
> >
> > <mx:grouping>
> >
> > <mx:Grouping>
> >
> > <mx:GroupingField name="cdReduzido"/>
> >
> > </mx:Grouping>
> >
> > </mx:grouping>
> >
> > </mx:GroupingCollection2>
> >
> > </mx:dataProvider>
> >
> > <mx:columns>
> >
> > <mx:AdvancedDataGridColumn headerText="CdReduzido" dataField="cdReduzido"
> />
> >
> > <*mx:AdvancedDataGridColumn* headerText="ID Debito" dataField="idDebito"
> />
> >
> > <mx:AdvancedDataGridColumn headerText="DS Histórico"
> dataField="dsHistorico"
> > />
> >
> > <mx:AdvancedDataGridColumn headerText="Periodo" dataField="periodo" />
> >
> > <mx:AdvancedDataGridColumn headerText="Encerrado" dataField="encerrado"
> />
> >
> > </mx:columns>
> >
> > </mx:AdvancedDataGrid>
> >
> > 2011/6/15 Principe borodin <[email protected]>
>  >
> >
> >
> >
> >
> >
> >
> > > funcionar, funciona, mas o cliente ker td em grupo, sao varios itens
> > > agrupados por categorias, e o cliente ker agrupado por categoria...
> >
> > > On 15 jun, 13:12, Re JMD <[email protected]> wrote:
> > > > Se você usar o <:S:Datagrid não funciona?
> >
> > > > 2011/6/15 [email protected] <[email protected]>
> >
> > > > > nao tenho nao, mas se eu nao agrupar, os dados nao aparecem...uma
> outra
> > > > > coisa, eu estou fazendo dragdrop, nao sei se ja citei...
> >
> > > > > Em 15 de junho de 2011 07:38, Re JMD <[email protected]>
> escreveu:
> >
> > > > >>  No segundo você não tem nescessidade de agrupar os dados?
> >
> > > > >> Em 14 de junho de 2011 16:06, Principe borodin <
> > > > >> [email protected]> escreveu:
> >
> > > > >> preciso pegar os dados de um advanced datagrid, sendo q o primeiro
> > > > >>> esta recebendo dados e esta agrupand, porem o segundo nao mostra
> os
> > > > >>> itens se nao agrupa-los..so q o seu dataprovider nao esta sendo
> > > > >>> preenchido, como fazer agora? o codigo segue abaixo
> >
> > > > >>> <?xml version="1.0" encoding="utf-8"?>
> > > > >>> <ns:MDIWindow xmlns:fx="http://ns.adobe.com/mxml/2009";
> > > > >>>                          xmlns:s="library://
> ns.adobe.com/flex/spark"
> > > > >>>                          xmlns:mx="library://
> ns.adobe.com/flex/mx"
> > > > >>>                          xmlns:ns="
> http://code.google.com/p/flexlib/
> > > "
> > > > >>>                          width="694" height="420"
> fontWeight="normal"
> > > > >>> layout="absolute"
> > > > >>> showControls="false"
> >
> > > > >>>                          creationComplete="init()">
> > > > >>>        <fx:Declarations>
> > > > >>>                <s:RemoteObject id="tp" destination="zendamf"
> > > > >>> source="TipoPeca">
> > > > >>>                        <s:method name="getPecaServico"
> > > > >>>  fault="fault(event)"
> > > > >>> showBusyCursor="true"  result="result(event)"/>
> > > > >>>                </s:RemoteObject>
> > > > >>>        </fx:Declarations>
> > > > >>>        <fx:Script>
> > > > >>>                <![CDATA[
> > > > >>>                        import mx.collections.ArrayCollection;
> > > > >>>                        import mx.collections.Grouping;
> > > > >>>                        import mx.collections.GroupingCollection2;
> > > > >>>                        import mx.collections.GroupingField;
> > > > >>>                        import mx.controls.Alert;
> > > > >>>                        import mx.events.DragEvent;
> > > > >>>                        import mx.managers.DragManager;
> > > > >>>                        import mx.rpc.events.FaultEvent;
> > > > >>>                        import mx.rpc.events.ResultEvent;
> >
> > > > >>>                        import vo.TipoPecasVO;
> >
> > > > >>>                        [Bindable]
> > > > >>>                        private var dpdgservicos:ArrayCollection ;
> >
> > > > >>>                        [Bindable]
> > > > >>>                        private var coluns:ArrayCollection=new
> > > > >>> ArrayCollection;
> > > > >>>                        [Bindable]
> > > > >>>                        private var detalhes:ArrayCollection = new
> > > > >>> ArrayCollection();
> > > > >>>                        private function init():void
> > > > >>>                        {
> > > > >>>                                tp.getPecaServico();
> > > > >>>                        }
> >
> > > > >>>                        private function fault(f:FaultEvent):void
> > > > >>>                        {
> > > > >>>                                Alert.show(f.fault.toString());
> > > > >>>                        }
> >
> > > > >>>                        private function
> result(r:ResultEvent):void
> > > > >>>                        {
> >
> > > > >>>                                servicos.dataProvider = r.result;
> > > > >>>                                var gcl:GroupingCollection2 = new
> > > > >>> GroupingCollection2;
> > > > >>>                                gcl.source =
> servicos.dataProvider;
> > > > >>>                                var gr:Grouping = new Grouping;
> > > > >>>                                var gfs:GroupingField = new
> > > > >>> GroupingField('tiposervico');
> > > > >>>                                gr.fields = [gfs];
> > > > >>>                                gcl.grouping = gr;
> > > > >>>                                gcl.refresh();
> > > > >>>                                servicos.dataProvider = gcl;
> >
> > > > >>>                                var gcl2:GroupingCollection2 = new
> > > > >>> GroupingCollection2;
> > > > >>>                                gcl2.source = detalhes;
> > > > >>>                                var gr2:Grouping = new Grouping;
> > > > >>>                                var gfs2:GroupingField = new
> > > > >>> GroupingField('tiposervico');
> > > > >>>                                gr2.fields = [gfs2];
> > > > >>>                                gcl2.grouping = gr2;
> > > > >>>                                gcl2.refresh();
> > > > >>>                                descricao.dataProvider = gcl2;
> >
> > > > >>>                        }
> >
> > > > >>>                        private function salva():void{
> >
> > >  //Alert.show(coluns.length.toString());
> > > > >>>                                var iten:String = "";
> > > > >>>                                for(var
> i:int=0;i<coluns.length;i++)
> > > > >>>                                {
> > > > >>>
>  iten+=coluns[i].idTipoPecas+"
> > > > >>>  "+coluns[i].peca+"
> > > > >>> "+coluns[i].descricao+"\n";
> > > > >>>                                }
> > > > >>>                                Alert.show(iten);
> >
> > > > >>>                        }
> > > > >>>                        private function
> completa(e:DragEvent):void{
> > > > >>>                        //      Alert.show(e.toString());
> > > > >>> //
> > >  Alert.show(servicos.selectedItem.idTipoPecas);
> > > > >>>                        //coluns.addItem(servicos.selectedItem);
> > > > >>>                        coluns.addItem(descricao.selectedItem);
> > > > >>>                        }
> >
> > > > >>>                        public function
> removePecaLista(o:Object):void
> > > > >>>                        {
> >
> > >
> descricao.dataProvider.removeChild(descricao.dataProvider.getParentItem(descricao.selectedItem),descricao.selectedItem);
> > > > >>>                        }
> > > > >>>                ]]>
> > > > >>>        </fx:Script>
> > > > >>>        <s:Image x="33" y="10"
> > > source="assets/img/elaborabriefing.png"/>
> > > > >>>        <s:Label x="65" y="18" color="#4C493B" fontSize="15"
> > > > >>> fontWeight="bold" text="ELABORANDO BRIEFING"/>
> > > > >>>        <s:ComboBox id="listCliente" x="33" y="95"/>
> > > > >>>        <s:ComboBox id="departamento" x="236" y="95"/>
> > > > >>>        <mx:AdvancedDataGrid id="servicos"  dragEnabled="true"
>  x="33"
> > > > >>> y="141"  width="146" designViewDataType="tree">
> >
> > > > >>>                <mx:columns>
> > > > >>>                        <mx:AdvancedDataGridColumn
> dataField="peca"
> > > > >>> headerText="SERVIÇOS"/>
> > > > >>>                </mx:columns>
> > > > >>>        </mx:AdvancedDataGrid>
> >
> > > > >>>        <mx:AdvancedDataGrid dragEnter="completa(event)"
> > > > >>>  dropEnabled="true"
> > > > >>> editable="true" id="descricao" x="235" y="141"
> > > > >>> designViewDataType="tree">
> > > > >>>                <mx:columns>
> > > > >>>                        <mx:AdvancedDataGridColumn
> dataField="peca"
> > > > >>> editable="false"
> > > > >>> headerText="PEÇA"/>
> > > > >>>                        <mx:AdvancedDataGridColumn
> > > dataField="quantidade"
> > > > >>> editable="true"
> > > > >>> itemEditor="mx.controls.NumericStepper" editorDataField="value"
> > > > >>> headerText="QUANTIDADE" />
> > > > >>>                        <mx:AdvancedDataGridColumn
> > > > >>> editorUsesEnterKey="true"
> > > > >>> editorHeightOffset="50" dataField="espeficicacao" editable="true"
> > > > >>> itemEditor="mx.controls.TextArea" editorDataField="text"
> > > > >>> headerText="ESPECIFICAÇÃO"/>
> > > > >>>                        <mx:AdvancedDataGridColumn
>  headerText="OPÇÃO"
> > > > >>> editable="false">
> > > > >>>                                <mx:itemRenderer>
> > > > >>>                                        <fx:Component>
> > > > >>>                                                <mx:HBox>
> > > > >>>
>  <fx:Script>
> >
> > >  <![CDATA[
> >
> > > > >>>  [Bindable]
> >
> > > > >>>  [Embed(source="assets/img/remover.png")]
> >
> > > > >>>  private var removerIcon:Class;
> >
> > > > >>>  import vo.TipoPecasVO;
> > > > >>>
>  ]]>
> > > > >>>
>  </fx:Script>
> > > > >>>                                                        <mx:Button
> > > > >>> icon="{removerIcon}"  styleName="barraOpces"
> > > > >>> click="outerDocument.removePecaLista(data)" toolTip="Remover peça
> da
> > > > >>> lista" width="100%" />
> > > > >>>                                                </mx:HBox>
> > > > >>>                                        </fx:Component>
> > > > >>>                                </mx:itemRenderer>
> > > > >>>                        </mx:AdvancedDataGridColumn>
> >
> > > > >>>                </mx:columns>
> > > > >>>        </mx:AdvancedDataGrid>
> > > > >>>        <s:Button x="505" y="350" label="CANCELAR"
> > > click="this.close();"
> >
> > ...
> >
> > mais »
>
> --
>  Você recebeu esta mensagem porque está inscrito na lista "flexdev"
> Para enviar uma mensagem, envie um e-mail para [email protected]
> Para sair da lista, envie um email em branco para
> [email protected]
> Mais opções estão disponíveis em http://groups.google.com/group/flexdev
>

-- 
Você recebeu esta mensagem porque está inscrito na lista "flexdev"
Para enviar uma mensagem, envie um e-mail para [email protected]
Para sair da lista, envie um email em branco para 
[email protected]
Mais opções estão disponíveis em http://groups.google.com/group/flexdev

Responder a