itemrenderer

Adobe Flex ItemRenderer: Making Calculations

家住魔仙堡 提交于 2019-12-13 04:57:59
问题 I have a database including a user's Date of Birth, but I want to display their age. I have a function which calculates the age but I cannot use it in the ItemRenderer and I don't know why. I don't think it will work if I use this code outside of the ItemRenderer. The DOB is accessed by {data.dob} . Here's my code: <s:GridColumn dataField="age" headerText="Age" width="80"> <s:itemRenderer> <fx:Component> <s:GridItemRenderer> <fx:Script> <![CDATA[ // Retrieving the user's DOB var dateStr

CheckBox itemrenderer in datagrid got selected/unselected while scrollling in FLEX

感情迁移 提交于 2019-12-13 04:02:05
问题 In my application i am having a datagrid which was created dynamically. For each and every cell in datagrid, i am having checkbox as itemrenderer. As of now it is working fine as expected.But while scrolling vertically the checkboxes getting selected/unselected automatically.I got this same problem in "horizontal scrolling" also, but i resolved it by setting "minWidth" for each columns. I am creating datagrid like this, for(i=0;i<recordCount;i++) { var obj:Object = new Object(); for(var j:int

The property still has the old value in validateProperties

一世执手 提交于 2019-12-13 02:43:49
问题 I have a custom renderer (inherits from AdvancedDataGridItemRenderer ), and I'm overriding validateProperties and using the value of the width property, but I'm getting the old value every time! Isn't validateProperties supposed to execute after the properties were committed (I'm calling super)? Here's my code: public override function validateProperties():void { super.validateProperties(); if ((AdvancedDataGrid(listData.owner).columns[listData.columnIndex]. showDataTips)&&(textWidth>width))

Weird Behaviour-CheckBoxes as ItemRenderer within Flex DataGrid - FLEX 3

十年热恋 提交于 2019-12-13 02:28:49
问题 I'm having this weird behaviour in a datagridColumn which I've customized to have its cells rendered as checkBoxes rather than the dafault itemRenderer (i.e. strings). The relevant code is as follows: <mx:DataGridColumn sortable="false" textAlign="center" headerText="" width="20" dataField="colCB"> <mx:itemRenderer> <mx:Component> <mx:CheckBox selected="true"> <mx:Script> <![CDATA[ import mx.controls.Alert; public function change():void{ //TODO } ]]> </mx:Script> </mx:CheckBox> </mx:Component

flex 3 and itemRenderers

邮差的信 提交于 2019-12-12 06:45:07
问题 i have a datagrid and for one of the columns im using an item renderer to display content. Im wondering is it possible to access the dataprovider content of the datagrid inside a script block in the itemRenderer. Currently I can access the dataprovider in a component in the item renderer using data.variableName. I want to be able do some error handling on this variable in the script block, any ideas? 回答1: You can specify your own ItemRenderer component. Within the MXML of that component you

Get changed value of Item from ItemRenderer in List

泪湿孤枕 提交于 2019-12-11 18:25:46
问题 I have a List with textInput as itemrenderer. Initially the list is loaded with data from a data provider. However since the items are rendered in textInputs, I have the ability to change the value of a particular item. But when trying to access the value of the changed item using the function below, I still get the old value in my trace: private function addItem(event:Event):void { trace(myDataProvider.getItemAt(myList.selectedIndex).label); } can someone tell me what I need to do for the

how to access the listData property in item renderer for datagrid in flex 4

心已入冬 提交于 2019-12-11 09:44:48
问题 I have a custom datagrid. I am passing value of hslider through a property criteria into it. I have an external itemrenderer for this datagrid which extends GridItemRenderer. I want to change the item renderer dynamically based on this property criteria. To access a property from parent component which is 'criteria' I want to access the listData property. For that this custom datagrid implements the IDropinItemRender. But the value of listData coming as null.In my main application I am using

How to trigger itemRendererFunction to be called again when data change in Flex

a 夏天 提交于 2019-12-11 09:04:02
问题 I have a list that uses a itemRendererFunction to get custom item renderers. Is there a way to only reevaluate one item in the list and get different item renderer? imagine code like this : there are two item renderers ItemRendererOne.mxml and ItemRendererTwo.mxml Data.as package { public class Data { private var _data : Boolean = false; [Bindable] public function get data():Boolean { return _data; } public function set data(value:Boolean) : void { _data = value; } public function Data(value

how to validate textinput within itemrenderer?

我的梦境 提交于 2019-12-11 08:45:49
问题 I have textinput within list itemrenderer like main.mxml <s:List id="videoAttachmentsList" itemRenderer.normalView="com.engage.discussion.attachment.renderers.VideoAttachmentRenderer" > <mx:button label="add" click=addevent(Event) /> VideoAttachmentRenderer.as <TextInput styleName="commonTextInput" prompt="Enter a video header" id="headerText" x="75" width="185" height="21" bottom="5" fontSize="10" maxChars="30"/> <fx:Declarations> <mx:StringValidator source="{headerText}" property="text"

Why would an Image-based itemRenderer always be visible?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 05:59:14
问题 Given the following code: <mx:DataGridColumn dataField="ongoing" id="ongoing" headerText="" width="20"> <mx:itemRenderer> <mx:Component> <mx:Image source="logo.jpg" visible="false" /> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> why would the image always be visible? I know for a fact that data.ongoing is always being set equal to 'False', and I know for a fact that the image is getting this information. That shouldn't even have anything to do with it, as far as I can tell, but I