1

一部の列が編集可能なデータグリッドがあります。available_quantity、sales_quantity、return_quantity の 3 つの列があり、そのうち sales_quantity と return_quantity は編集可能です。私が欲しいのは、ユーザーが sales_quantity と return_quantity を入力すると、合計が available_quantity よりも大きい場合、すぐにアラートが表示されるはずです。これを処理するためにkeyupイベントを書きました..

protected function dataGrid_keyUpHandler(event:KeyboardEvent):void
        {
            // TODO Auto-generated method stub
            var avail_qty:int=parseInt(dataGrid.selectedItem.available_qty);
            var return_qty:int=parseInt(dataGrid.selectedItem.return_qty);
            var sales_qty:int=parseInt(dataGrid.selectedItem.sales_qty);
            var total:int=return_qty + sales_qty;
            if(total>avail_qty)
             Alert.show("hi");
        }

but the problem is first time when i edit the value sales_quantity and return_quantity it does not show me alert even there total is greater than available_quantity. If i click any one of the column again and press backspace then it shows me "hi" in alert. which event should b used to handle this. Keypressed event is not available in datagrid

4

1 に答える 1

2

DataGridのヘルプページはどうですか?

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/controls/DataGrid.html#eventSummary ???

私はこのイベント「itemEditEnd」を聞きます:)


更新-SparkDataGrid

フレックスマニュアルの次のイベントの説明を参照してください。

gridItemEditorSessionCancel
Dispatched after the item editor has been closed without saving its data.   

gridItemEditorSessionSave
Dispatched after the data in item editor has been saved into the data provider and the editor has been closed.  

gridItemEditorSessionStart
Dispatched immediately after an item editor has been opened.    

gridItemEditorSessionStarting
Dispatched when a new item editor session has been requested.
于 2012-05-31T11:21:59.713 に答える