1 Reply Latest reply on Jan 6, 2013 11:06 PM by Supreet R

    unable to add button to spark datagrid

    autokads

      when i add the code and launch, i get a white screen - no errors.  I'm able to do it in the flex libraries but not spark, here is my code (top does not work so commented out)

       

      <s:DataGrid dataProvider="{EdsDataArray}" width="100%">

                                    <s:columns>

                                              <s:ArrayList>

                                                        <s:GridColumn dataField="id"/>

                                                        <s:GridColumn dataField="NAME"/>

                                                        <s:GridColumn headerText="Remove">

                                                                  <!--s:itemRenderer>

                                                                            <fx:Component>

                                                                                      <mx:Button label="Delete" click=""/>

                                                                            </fx:Component>

                                                                  </s:itemRenderer-->

                                                        </s:GridColumn>

                                              </s:ArrayList>

                                    </s:columns>

                          </s:DataGrid>

       

                          <mx:DataGrid id="dg" dataProvider="{EdsDataArray}" width="100%">

                          <mx:columns>

                                    <mx:DataGridColumn headerText="ID" dataField="id"/>

                                    <mx:DataGridColumn headerText="NAME" dataField="NAME"/>

                                    <mx:DataGridColumn headerText="Remove">

                                              <mx:itemRenderer>

                                                        <fx:Component>

                                                                  <mx:Button label="Delete" click=""/>

                                                        </fx:Component>

                                              </mx:itemRenderer>

                                    </mx:DataGridColumn>

                          </mx:columns>

        </mx:DataGrid>

        • 1. Re: unable to add button to spark datagrid
          Supreet R

          Hi,

           

          Try the following to work for Spark:

              

          <s:GridColumn headerText="Remove" editable="false">

              <s:itemRenderer>

                  <fx:Component>

                      <s:GridItemRenderer>

                          <s:Button label="Delete" />                               

                      </s:GridItemRenderer>

                  </fx:Component>

              </s:itemRenderer>

          </s:GridColumn>