简体   繁体   中英

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. How i can get manually entered value in datagrid column on first click of button.

Thanks Adavance!!!

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);
}

//This above function used to add value of numeric stepper in datagrid column

-->

        <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? Or to the DataGrid's 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. In your dataProvider is a collection class, you can use the itemUpdated() method.

dataProvider.itemUpdateD(myUpdatedItem);

Which will trigger the DataGrid to update. You can also use the refresh method:

dataProvider.refresh();

But, considering the lack of code you provided, I'm just guessing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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