【问题标题】:flex datagrid problemflex 数据网格问题
【发布时间】:2009-02-20 16:07:55
【问题描述】:

我的应用程序中有一个数据网格,并且正在使用 php 从 MYSQL DB 中提取数据。 有没有办法将所有数据存储到数组中并将其传递给函数,或者是否可以将数据直接存储到数组中而不是从数据网格中提取 这是代码

<mx:DataGrid id="dgUserRequest" x="150" y="10" dataProvider="  {userRequest.lastResult.users.user}" editable="false">

    <mx:columns>
        <mx:DataGridColumn headerText="UserID" dataField="userid"/>
        <mx:DataGridColumn headerText="Ip Address" dataField="ip"/>
        <mx:DataGridColumn headerText="latitude" dataField="lat"/>
        <mx:DataGridColumn headerText="longitude" dataField="lng"/>
    </mx:columns>

</mx:DataGrid>
<mx:HTTPService id="userRequest" url="http://localhost/post.php" useProxy="false" method="POST">
    <mx:request xmlns="">
    </mx:request>
    </mx:HTTPService>

【问题讨论】:

    标签: apache-flex datagrid


    【解决方案1】:

    为 HTTPService 的“结果”事件添加一个监听器,并让监听器函数中的代码填充一个本地存储的数组。

    【讨论】:

      【解决方案2】:

      这样的事情应该会有所帮助

      [Bindable]
      public var dp:ArrayCollection;
      
      
      
      protected function samplePhp_resultHandler(event:ResultEvent):void
      {
      dp = event.result as ArrayCollection;
      }
      
      <mx:HTTPService id="userRequest" url="http://localhost/post.php"                               useProxy="false"         
         method="POST" result="samplePhp_resultHandler">
      <mx:request xmlns="">
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-09-05
        • 1970-01-01
        • 2011-10-12
        • 2010-10-11
        • 1970-01-01
        • 2011-07-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多