Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-26779

DataGrid Problem

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • Adobe Flex SDK Previous
    • None
    • mx: DataGrid
    • None
    • Affected OS(s): Windows
      Affected OS(s): Windows XP
      Language Found: English

    Description

      Steps to reproduce:
      Example Code:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      <![CDATA[
      [Bindable]
      private var dp:Array = [

      { STAFF_CODE: "admin", STAFF_NAME: "Sys Admin",isSelected:true}

      ,

      { STAFF_CODE: "6073", STAFF_NAME: "testuser",isSelected:false}

      ,

      { STAFF_CODE: "dormouse", STAFF_NAME: "no code",isSelected:false}

      ];
      ]]
      >
      </mx:Script>
      <mx:DataGrid dataProvider="

      {dp}

      " width="100%">
      <mx:columns>
      <mx:DataGridColumn headerText="isSelected" dataField="isSelected" visible="false"/>
      <mx:DataGridColumn headerText="Staff Code" dataField="STAFF_CODE"/>
      <mx:DataGridColumn headerText="Staff Name" dataField="STAFF_NAME"/>
      </mx:columns>
      </mx:DataGrid>
      </mx:Application>

      1.set 'isSelected' column visible="false"
      2.click 'Staff Code' column to sort
      3.enter word it will find in 'Staff Code' column, but actual finding in 'Staff Name' column.

      DataGrid.as Source Code:

      Function:
      /**

      • @private
      • used by ListBase.findString. Shouldn't be used elsewhere
      • because column's itemToLabel is preferred
        */
        override public function itemToLabel(data:Object):String { return displayableColumns[sortIndex == -1 ? 0 : sortIndex].itemToLabel(data); }

      the sortIndex is columns index, the function should be like this:
      override public function itemToLabel(data:Object):String

      { return _columns[sortIndex == -1 ? 0 : sortIndex].itemToLabel(data); }

      Attachments

        Issue Links

          Activity

            People

              paeros Mark Kessler
              adobejira Adobe JIRA
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: