[英]FLEX 4 Numeric Stepper value update problem?
我在 MXML 組件中有數字步進器。當我手動輸入數值並按下按鈕以在我的 datagrid 列行中添加當前值時。第一次它在 datagrid 列中沒有影響。但是當我點擊我的 datagrid 列中的第二次值時. 我如何在第一次單擊按鈕時在 datagrid 列中手動輸入值。
謝謝提前!!!
protected function id_btnAdd_mouseDownHandler(event:MouseEvent):void { { edlColor = new EDLColor(); edlColor.ColorToString = "rgb(0,0,0)";
edlColor.Extent = id_extent.value; elxFrame.ShapeStyle.ColorList.AddColor(edlColor); dispatchEvent(new ECContextChangeEvent(ECContextChangeEvent.CONTEXT_CHANGE, this, edlColor, ContextConstants.COLOR_CONTEXT)); } //edlColor = new EDLColor(); //colorList.AddColor(color);
}
//上面的function用於在datagrid列中添加數字步進器的值
-->
<mx:Spacer width="90%"/>
<customclasses:IconButton id="id_btnAdd" name="{TDCommonConstants.IMAGE}"
skinClass="assets.skins.designer.IconButtonSkin"
icon="{Icons.Add}"
mouseOverIcon="{Icons.Add}"
mouseDownIcon="{Icons.Add}"
toolTip="{resourceManager.getString(TDCommonConstants.RESOURCE_LABELS,'ADD')}"
mouseDown="id_btnAdd_mouseDownHandler(event)"
height="12" width="10"/>
<customclasses:IconButton id="id_btnRemove" name="{TDCommonConstants.IMAGE}"
skinClass="assets.skins.designer.IconButtonSkin"
icon="{Icons.Remove}"
mouseOverIcon="{Icons.Remove}"
mouseDownIcon="{Icons.Remove}"
toolTip="{resourceManager.getString(TDCommonConstants.RESOURCE_LABELS,'REMOVE')}"
mouseDown="id_btnRemove_mouseDownHandler(event)"
height="12" width="10"/>
</s:HGroup>
<s:HGroup height="90%" width="100%">
<mx:DataGrid id="id_variableRefList" width="100%" height="95%">
<mx:columns>
<mx:DataGridColumn id="id_strip" sortable="false" >
<mx:itemRenderer>
<fx:Component>
<mx:HBox width="100%" height="100%" backgroundColor="{data.UnsignedInt}" mouseDown="{outerDocument.hbox1_mouseDownHandler(event)}">
</mx:HBox>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn id="id_opacity" sortable="false"/>
</mx:columns>
</mx:DataGrid>
</s:HGroup>
</s:VGroup>
您是否嘗試將值添加到 dataGrid 列行? 還是到DataGrid 的dataProvider? 如果您正在更新 dataProvider,則 DataGrid 不會自動更新 itemRenderer,因為 dataChange 事件不會自動觸發。 在您的 dataProvider 中是一個集合 class,您可以使用itemUpdated()方法。
dataProvider.itemUpdateD(myUpdatedItem);
這將觸發 DataGrid 更新。 您還可以使用刷新方法:
dataProvider.refresh();
但是,考慮到您提供的代碼不足,我只是在猜測。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.