0
votes

I am trying to overlay a label onto an AdvancedDataGrid when there are no results returned from a call for the data.

Here is a mockup of what I am trying to accomplish http://i.stack.imgur.com/6Djga.png

I tried following this previous answer: Drawing an overlay in custom flex component, but this would not work for me because an AdvancedDataGrid is not a Container (and as such does not have a rawChildren property).

I would prefer not to need to mess with the data provider, because this table will be used in many location which will have different columns and labelFields.

Any suggestions welcome.

2

2 Answers

2
votes

To give a quick example as to what Flextras mentioned:

<s:Group>
  <mx:DataGrid dataProvider="{myDataProvider}">
    <mx:columns>
      <mx:DataGridColumn dataField="test1" />
      <mx:DataGridColumn dataField="test2" />
      <mx:DataGridColumn dataField="test3" />
      <mx:DataGridColumn dataField="test4" />
    </mx:columns>
  </mx:DataGrid>

  <s:Label text="Overlay text here" visible="{myDataProvider.length == 0}" x="10" y="35" />
</s:Group>
0
votes

Put the AdvancedDataGrid in a container along with the label overlay. Position the label on top of the DataGrid; and change it's visibility based on the dataProvider's length.