简体   繁体   English

FLEX 4 Numeric Stepper 值更新问题?

[英]FLEX 4 Numeric Stepper value update problem?

i have numeric stepper in MXML component.when i entered manually numeric value and press a button to add the current value in my datagrid column row.First time its not effected in datagrid column.But when i clicked second time value effected in my datagrird column.我在 MXML 组件中有数字步进器。当我手动输入数值并按下按钮以在我的 datagrid 列行中添加当前值时。第一次它在 datagrid 列中没有影响。但是当我点击我的 datagrid 列中的第二次值时. How i can get manually entered value in datagrid column on first click of button.我如何在第一次单击按钮时在 datagrid 列中手动输入值。

Thanks Adavance!!!谢谢提前!!!

protected function id_btnAdd_mouseDownHandler(event:MouseEvent):void { { edlColor = new EDLColor(); protected function id_btnAdd_mouseDownHandler(event:MouseEvent):void { { edlColor = new EDLColor(); edlColor.ColorToString = "rgb(0,0,0)"; edlColor.ColorToString = "rgb(0,0,0)";
edlColor.Extent = id_extent.value; edlColor.Extent = id_extent.value; elxFrame.ShapeStyle.ColorList.AddColor(edlColor); elxFrame.ShapeStyle.ColorList.AddColor(edlColor); dispatchEvent(new ECContextChangeEvent(ECContextChangeEvent.CONTEXT_CHANGE, this, edlColor, ContextConstants.COLOR_CONTEXT)); dispatchEvent(new ECContextChangeEvent(ECContextChangeEvent.CONTEXT_CHANGE, this, edlColor, ContextConstants.COLOR_CONTEXT)); } //edlColor = new EDLColor(); } //edlColor = new EDLColor(); //colorList.AddColor(color); //colorList.AddColor(color);
} }

//This above function used to add value of numeric stepper in datagrid column //上面的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>

Are you trying to add values to the dataGrid Column row?您是否尝试将值添加到 dataGrid 列行? Or to the DataGrid's dataProvider?还是到DataGrid 的dataProvider? If you're updating the dataProvider, then the DataGrid won't necesarilly automatically update the itemRenderer, because the dataChange event won't fire automatically.如果您正在更新 dataProvider,则 DataGrid 不会自动更新 itemRenderer,因为 dataChange 事件不会自动触发。 In your dataProvider is a collection class, you can use the itemUpdated() method.在您的 dataProvider 中是一个集合 class,您可以使用itemUpdated()方法。

dataProvider.itemUpdateD(myUpdatedItem);

Which will trigger the DataGrid to update.这将触发 DataGrid 更新。 You can also use the refresh method:您还可以使用刷新方法:

dataProvider.refresh();

But, considering the lack of code you provided, I'm just guessing.但是,考虑到您提供的代码不足,我只是在猜测。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM