将2个dataGrids合并为一个状态

时间:2010-09-24 12:05:08

标签: actionscript-3 flex flex4 halo

<mx:DataGrid id="grid" width="100%" height="100%" sortableColumns="true"
             itemClick.ordersState="{_selectedOrder=grid.selectedItem.ordersState}"
             selectable.ordersState="true" includeIn="locationsState, ordersState" >
    <mx:columns >
        <mx:DataGridColumn dataField="name" headerText="Name" includeIn="locationsState"/> ->ex Location grid
        <mx:DataGridColumn dataField="locationTypeName" headerText="Type" includeIn="locationsState" /> ->ex Location grid
        <mx:DataGridColumn dataField="uid" headerText="Number" includeIn="ordersState" /> ->ex Orders grid
        <mx:DataGridColumn headerText="Order #" dataField="orderId" includeIn="ordersState"/> ->ex Orders grid
        <mx:DataGridColumn headerText="Status" dataField="orderStatus" includeIn="ordersState"/> ->ex Orders grid
        <mx:DataGridColumn dataField="customerName" headerText="Customer" includeIn="ordersState" /> ->ex Orders grid
    </mx:columns>
</mx:DataGrid>

并更改了此类提供商

private function _ws_result_order(e:ResultEvent):void
{
  grid.dataProvider.ordersState = e.result;
}

private function _ws_result(e:ResultEvent):void
{
  grid.dataProvider.locationsState = e.result;
}

我收到错误:

  

Halo导航器的子项必须实现INavigatorContent。 ReceiveIn.mxml / work / src / ui / fragments line 332 Flex问题

1 个答案:

答案 0 :(得分:1)

听起来你已经使用了viewstack或tabNavigator。

在这种情况下,您需要执行以下操作之一:

<ViewStack>
     <Canvas>
         <DataGrid />
     </Canvas>
</Viewtack>

(即,将您的dataGrid包装在Canvas中)

<Viewstack>
     <NavigatorContent>
          <Group>
              <DataGrid />
          </Group>
      </NavigatorContent>
 </Viewstack>

(即,将您的DataGrid包装在一个组中,并将该组包装在NavigatorContent标记内。)

注意 - 方法与标签导航器的方法相同。