1 Reply Latest reply on Apr 14, 2010 10:57 PM by Sameer Bhatt

    BUG in AdvancedDataGrid?

    FlexVexed

      Editable does not work as advertised in the documentation. (FB3 w SDK 3.5)

       

      From the docs for the "editable" property at http://livedocs.adobe.com/flex/3/langref/mx/controls/AdvancedDataGridBaseEx.html#editable:

      "

      If "item", the item renderers in the control are editable.       The user can click on an item renderer to open an editor.

      ...

      If "item summary", the item renderers and summary cells can  be edited.

      "

       

      This seems to indicate that if editable is set to "item" then summary cells will not be editable. This is not the case. Here is a sample app that shows the "editable" property does not work this way.

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application  xmlns:mx="http://www.adobe.com/2006/mxml"  layout="absolute">
        <mx:AdvancedDataGrid  initialize="gc.refresh()" editable="item">
           <mx:dataProvider>
            <mx:GroupingCollection id="gc">
               <mx:source>
                <mx:ArrayCollection>
                   <mx:Object day="1" hour="1" Skill0="1"/>
                   <mx:Object day="1" hour="2" Skill0="1.5"/>
                   <mx:Object day="1" hour="3" Skill0=".25"/>
                 </mx:ArrayCollection>
              </mx:source>
               <mx:grouping>
                <mx:Grouping>
                   <mx:GroupingField name="day">
                     <mx:summaries>
                      <mx:SummaryRow  summaryPlacement="group">
                        <mx:fields>
                           <mx:SummaryField dataField="Skill0"/>
                         </mx:fields>
                      </mx:SummaryRow>
                     </mx:summaries>
                  </mx:GroupingField>
                 </mx:Grouping>
              </mx:grouping>
             </mx:GroupingCollection>
          </mx:dataProvider>
           <mx:columns>
            <mx:AdvancedDataGridColumn  dataField="day"/>
            <mx:AdvancedDataGridColumn  dataField="hour"/>
            <mx:AdvancedDataGridColumn  dataField="Skill0"/>
          </mx:columns>
         </mx:AdvancedDataGrid>
      </mx:Application>

       

      Here is a screenshot of the result showing that the summary  row is editable:

      editableNotWorking.jpg

      Is this correct functionality or a bug? If it is correct, then is there a way to make the summary cells read-only?

       

      Thanks,

      Matt

        • 1. Re: BUG in AdvancedDataGrid?
          Sameer Bhatt Adobe Employee

          Seems like a bug. Can you log it.

           

          If you have the source for AdvancedDataGrid, you can make it working by changing - AdvancedDataGridBaseEx.mouseUpHandler()

          Change this statement -

                  else if (lastItemDown && lastItemDown != itemEditorInstance)
          

          to -

                  else if (lastItemDown && lastItemDown != itemEditorInstance && isDataEditable(r.data))
          

           

          Please note that this is not an official tested fix, though it seems to work well for your sample.

          1 person found this helpful