2013-04-05 105 views
0

我試圖改變火花數據網格中選定的行時,選項卡通過最後一列。換句話說,我想突出顯示行以跟隨活動單元格。Flex 4 spark數據網格選擇行更改與選項卡

任何想法?

謝謝。

+0

您是否想要使用Tab更改活動行,或者應該使用Tab訪問行中的每個單元格,並且在訪問最後一行之後,應選擇下一行的第一個單元格? – Anton 2013-04-06 21:02:30

+0

使用Tab更改活動行。就像在MX數據網格中找到的默認行爲一樣。 – jayron 2013-04-06 21:10:00

+0

這是一個很好的例子http://squaredi.blogspot.de/2011/09/precision-focus-control-within-spark.html – Anton 2013-04-06 23:27:33

回答

1

下面是我如何去了解它。 我有我的選擇變化和caretChange網格上執行相同的功能事件。

<s:DataGrid id="my_rates_grid" x="0" y="0" width="100%" height="100%" 
          creationComplete="my_rates_grid_creationCompleteHandler(event)" 
          editable="true" alternatingRowColors="[#FFFFFF, #e9f1f6]" 
          gridItemEditorSessionSave="my_rates_grid_gridItemEditorSessionSaveHandler(event)" 
          requestedRowCount="4" 
          selectionChange="my_rates_grid_selectionChangeHandler(event)" 
          caretChange="my_rates_grid_selectionChangeHandler(event)"> 

然後在my_rates_grid_selectionChangeHandler功能(請注意,我不得不改變其參數類型,以通用型事件)

protected function my_rates_grid_selectionChangeHandler(event:Event):void 
     { 
      if(my_rates_grid.editorRowIndex >= 0){ 
       trace("it's happening"); 
       my_rates_grid.setSelectedIndex(my_rates_grid.editorRowIndex); 
      } 


     } 

所以每次我標籤將遵循和保存功能捕獲我的新值也是如此。

+0

很酷。謝謝!我會試一試。 – jayron 2013-10-31 00:42:37