Apache flex Flex:如何将数据链接到数据网格?

Apache flex Flex:如何将数据链接到数据网格?,apache-flex,datagrid,flex4,flash-builder,Apache Flex,Datagrid,Flex4,Flash Builder,我正在学习flex教程,但我并没有完全按照他们所做的去做,所以: 我想要什么 我有一个输入文本,带有一个“搜索”按钮 单击此按钮时,我希望函数搜索返回的数据显示在datagrid中。 我所拥有的: 文本输入: <s:TextInput includeIn="DetailServeurs" x="58" y="361" width="209" id="txt_search" text="Default text" focusIn="txt_search_focusInHandler(even

我正在学习flex教程,但我并没有完全按照他们所做的去做,所以:

我想要什么

我有一个输入文本,带有一个“搜索”按钮

单击此按钮时,我希望函数搜索返回的数据显示在datagrid中。

我所拥有的:

文本输入:

<s:TextInput includeIn="DetailServeurs" x="58" y="361" width="209" id="txt_search" text="Default text" focusIn="txt_search_focusInHandler(event)"/>
和数据网格:

<mx:DataGrid includeIn="DetailServeurs" x="30" y="124" width="1002" height="179" id="dataGrid" dataProvider="{getServeurByNameResult.lastResult}">
    <mx:columns>
        <mx:DataGridColumn headerText="GSP_nom" dataField="GSP_nom"/>
        <mx:DataGridColumn headerText="port" dataField="port"/>
               ........
    </mx:columns>
</mx:DataGrid>

........

那么如何在datagrid中显示结果呢?谢谢!;)

问题解决了。我不能告诉你确切的原因,但我得到了帮助

protected function btn_rechercher_clickHandler(event:MouseEvent):void
        {
            if(txt_search.text != ""){
                getServeurByNameResult.token = serveurService.getServeurByName(txt_search.text);
            }
        }
<mx:DataGrid includeIn="DetailServeurs" x="30" y="124" width="1002" height="179" id="dataGrid" dataProvider="{getServeurByNameResult.lastResult}">
    <mx:columns>
        <mx:DataGridColumn headerText="GSP_nom" dataField="GSP_nom"/>
        <mx:DataGridColumn headerText="port" dataField="port"/>
               ........
    </mx:columns>
</mx:DataGrid>