6 Replies Latest reply on Mar 4, 2011 12:07 AM by Medium_Aevum

    Spark DataGrid edit

    AMIR820321548863 Level 1

      Hi

       

      I have search allot and couldn't find any way to make The Spark DataGrid editable for user input.

      Is it  possible at all or do I need to use MX DataGrid?

       

       

      Thanks

        • 2. Re: Spark DataGrid edit
          Jorge Raimundo Level 2

          Hello!

           

          I believe that in this stage of the Spark DataGrid it's not yet possible to edit the DataGrid's contents.

           

          You can check here:

           

          The Spark DataGrid functionality is divided into two tiers. The Tier 1 functionality is available in the “Hero” preview release, and the Tier 2 functionality is on-going. The Tier 1 functionality lays the groundwork for a new skinning contract which allows the DataGrid’s subparts to be customized declaratively via the DataGrid skin file. Additionally, full support for a dynamically changing data provider along with fixed and variable row sizes are incorporated into the layout and the communication between the DataGrid column headers and table area. Tier 1 also contains full selection support. Like the MX DataGrid, single and multiple row selection is enabled (both contiguously and non-contiguously). Additionally, the Spark DataGrid allows users to select individual cells or multiple cells as part of the default selection behavior. And finally, the Tier 1 functionality allows for basic user navigation through the keyboard or mouse.

          The Tier 2 functionality is currently under development. Tier 2 introduces advanced column functionality like column resizing and sorting as well as cell editing, polish to the skinning contract and a significant amount of performance work.

          1 person found this helpful
          • 3. Re: Spark DataGrid edit
            AMIR820321548863 Level 1

            Thanks

            Back to MX DataGrid...

            • 4. Re: Spark DataGrid edit
              Darrell Loverin Level 4

              The Spark DataGrid is editable. The editable property is supported on the Spark DataGrid as it is on the MX DataGrid.

               

              Editors now have to be of type IGridItemEditor. There are two built-in editors, DefaultGridItemEditor and ComboBoxGridItemEditor.

               

               

              -Darrell

              • 5. Re: Spark DataGrid edit
                Zolotoj Level 3

                This is my code for the editable DataGrid:

                <s:DataGrid requestedRowCount="4" fontSize="11" sortableColumns="false"
                                                   id="personnel" rowHeight="22" height="100%">
                                         <s:columns>
                                              <s:ArrayList>
                                                   <s:GridColumn dataField="person_id" headerText="Person" width="95">
                                                        <s:itemRenderer>
                                                             <fx:Component>
                                                                  <s:GridItemRenderer>
                                                                       <s:layout>
                                                                            <s:VerticalLayout paddingLeft="2" 
                                                                                 verticalAlign="middle"/>
                                                                       </s:layout>
                                                                  </s:GridItemRenderer>
                                                             </fx:Component>
                                                        </s:itemRenderer>
                                                   </s:GridColumn>     
                                                   <s:GridColumn dataField="name_id" headerText="Name" width="160">
                                                        <s:itemRenderer>
                                                             <fx:Component>
                                                                  <s:GridItemRenderer>
                                                                       <s:layout>
                                                                            <s:VerticalLayout paddingLeft="2" 
                                                                                                  verticalAlign="middle"/>
                                                                       </s:layout>
                                                                  </s:GridItemRenderer>
                                                             </fx:Component>     
                                                        </s:itemRenderer>
                                                   </s:GridColumn>
                                                   <s:GridColumn dataField="worknum" headerText="Work#" width="50">
                                                        <s:itemRenderer>
                                                             <fx:Component>
                                                                  <s:GridItemRenderer>
                                                                       <s:layout>
                                                                            <s:VerticalLayout verticalAlign="middle" paddingLeft="2"/>
                                                                       </s:layout>
                                                                       <s:Label text="{XML(data).worknum.toString()}" 
                                                                                  fontWeight="bold" fontSize="12" 
                                                                                  width="90" textAlign="left"/>
                                                                  </s:GridItemRenderer>
                                                             </fx:Component>     
                                                        </s:itemRenderer>
                                                   </s:GridColumn>
                                                   <s:GridColumn>
                                                        <s:itemRenderer>
                                                             <fx:Component>
                                                                  <s:GridItemRenderer>
                                                                       <s:layout>
                                                                            <s:HorizontalLayout verticalAlign="middle" 
                                                                                 horizontalAlign="center"/>
                                                                       </s:layout>
                                                                       <local:deleteRowDataGrid
                                                                            toolTipStr="Remove Person" ownerGrd="personnel">
                                                                       </local:deleteRowDataGrid>                                       
                                                                  </s:GridItemRenderer>
                                                             </fx:Component>     
                                                        </s:itemRenderer>
                                                        <s:headerRenderer>
                                                             <fx:Component>
                                                                  <s:DefaultGridHeaderRenderer>
                                                                       <local:addNewRowDataGrid
                                                                            toolTipStr="Add Person" eventToRise="addNewPerson">
                                                                       </local:addNewRowDataGrid>
                                                                  </s:DefaultGridHeaderRenderer>
                                                             </fx:Component>
                                                        </s:headerRenderer>
                                                   </s:GridColumn>
                                              </s:ArrayList>                         
                                         </s:columns>
                                    </s:DataGrid>
                
                • 6. Re: Spark DataGrid edit
                  Medium_Aevum

                  What if one would want to incorporate mx DateField as an itemEditor in the spark DataGrid? Is that possible?

                   

                  Thanks,

                   

                  Timur77