一部の列が編集可能なデータグリッドがあります。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