DataGrid itemRenderer column problem
I have searched high and low and have not found a solution so I'm hoping someone here can help me out.
When I start up my application, my datagrid (one of the columns uses a itemrenderer) that column, displays everything but it spills / shows funky, then when I scroll some of them get fixed. I don't know exactly what causes this or how to fix it. The column I'm talking about is the "Like" column.
If code is needed I will provide a pastebin link when requested, and I have attatched a screenshot of what the problem is.
Any help / suggestions would be appreciated
Upgrade to 3.4.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui
Similar Messages
-
DataGrid.itemRenderer Property problem
Hi newbie to AS3:
I have a DataGrid built dynamically with AS3 where
I need to change the color of a certain row.
I tried the following code but Its usage is certainly wrong:
cDtgc1.itemRenderer = cDtgc1.getItemRendererFactory(false,
BackgroundComp);
BackgroundComp is a class included is the code below.
How do I use this factory? The way I have it it is not
executing
Thanks.
Texttry:
cDtgc1.itemRenderer = new ClassFactory(BackgroundComp );
for some alternatives try this:
http://weblogs.macromedia.com/pent/archives/2007/02/coloring_the_ba.html
ATTA -
Datagrid Itemrenderer scrolling problem
Hi,
I have a datagrid bound to an ArrayCollection. For one column
I have a custom item renderer - which is a textbox.
It works OK except when you scroll the rows and values get
jumbled up randomly.
I'd be grateful if anyone has any ideas.
Thanks,
danHi Keytree,
Many thanks for the explanation.
However i still can't get it to work.
Please find the codes below and please check and advise if
i've missed something.
thx and regards
Benoit
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="
http://www.adobe.com/2006/mxml"
horizontalAlign="center">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
// Define a property for returning the new value to the
cell.
public var result:String="";
[Bindable]
private var dp: Array = [
{label:"None",data:1},
{label:"Amt", data:2},
{label:"%", data:3}
public var retObj:Object;
public static var test:Number=0;
// Override the set method for the data property.
override public function set data(value:Object):void
test++;
retObj=value;
//Alert.show(new String(test));
super.data = value;
if (value != null)
var currentValue:String = value.size;
var len:int = dp.length;
for (var i:int = 0; i < len; i++)
if (dp
.data == currentValue)
editor.selectedIndex = i;
break;
override public function get data():Object
return retObj;
public function onChange():void
//what need to be set here??
]]>
</mx:Script>
<mx:ComboBox id="editor" dataProvider="{dp}" width="130"
change="onChange()"/>
</mx:VBox> -
DataGrid ItemRenderer - display image
I have a DataGrid and I'd like to display different images
(PNG files) in one of the columns based on the value for a given
row.
Say I have an object which looks like this:
public class LogMsg {
public var type:String;
public var msg:String;
My DataGrid uses an ArrayCollection of LogMsg objects as its
"dataProvider". I'd like the "type" column of my DataGrid to
display an image instead of the text (i.e. "error", "info",
"debug").
<mx:DataGrid>
<mx:columns>
<mx:DataGridColumn dataField="type" headerText="Type"
itemRenderer="????" />
<mx:DataGridColumn dataField="msg" headerText="Message"
/>
</mx:columns>
</mx:DataGrid>
How would I go about doing this? My application structure on
disk looks like this:
C:\my_app
C:\my_app\assets
C:\my_app\assets\error.png
C:\my_app\assets\info.png
C:\my_app\assets\debug.png
C:\my_app\src\Main.mxml
C:\my_app\src\view\MyDataGrid.mxml <-- this is the one
with the DataGrid shown above.
Thanks in advance.<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
[Embed(source="logo.gif")]
[Bindable]
public var imgCls:Class;
]]>
</mx:Script>
<mx:HBox>
<mx:Image id="myImageRaw" source="{imgCls}"/>
</mx:HBox>
</mx:Application> -
Datagrid vertical scrollbar problem
I wrote a search function for a datagrid component. The
dataprovider is a ArrayCollection variable. If the item is found in
the array, set the item to be selected in the datagrid. The problem
is when the selected item is at bottom of the datagrid, the
scrollbar doesn't refresh so I have to manually move the scrollbar
to see the selected item. Here is part of my code:
<mx:Script>
<![CDATA[
......(populate accountData using dataservice)
accountDS.fill(accountData);
private function findAccountById(id:String):void
var size:int = accountData.length - 1;
for(var i:int = 0; i< size; i++) {
var account:Object = accountData.getItemAt(i);
if(account.accountNumber.search(id) != -1)
dgAccount.selectedIndex = i;
break;
]]>
</mx:Script>
<mx:ArrayCollection id="accountData"/>
<mx:DataService id="accountDS"
destination="accountlist"/>
<mx:Panel >
<mx:DataGrid id="dgAccounts" dataProvider="{accountData}"
editable="false">
<mx:columns>
<mx:DataGridColumn dataField="accountNumber"/>
<mx:DataGridColumn dataField="accountType" />
</mx:columns>
</mx:DataGrid>
</mx:Panel>You need to look at the API for DataGrid. Particularly the
property "verticalScrollPosition".
The logic in your expectation that setting selectedIndex
should update the scroll position is flawed. What if you selected
an item with the mouse and then wanted to browse the other options?
You would use the scroll bar for this. Your selection might
disappear from the list but you would want it to stay selected.
Thus the scroll position and the selected index are completely
independent of one another.
The point I am trying to make is this: you are required to
set the verticalScrollPosition when you set selectedIndex if you
want them to work in concert. -
TabIndex in DataGrid ItemRenderer Component
How to implement tabindex for the DataGrid ItemRenderer
Component?Any
idea Please."ravi_bharathii" <[email protected]> wrote
in message
news:gbv9ps$k6r$[email protected]..
> How to implement tabindex for the DataGrid ItemRenderer
Component?Any
> idea Please.
Is this what you wanted?
http://blogs.adobe.com/aharui/2008/08/datagrid_itemeditor_with_two_i.html -
Flex datagrid data column / webservice
I use a web service to populate a datagrid and its columns
(on of which is date). The web services sources the data from a sql
server database and thru ASP.net to the Flex application. I've been
seeing strange things. During testing, database records such as
"8/27/2008 8:58:00 PM " correctly shows up as 8/27/2008 in the Flex
application, but records after 9PM such as "8/27/2008 9:01:21 PM"
shows up as 8/28/2008 (the next days) .. seems like after 9 throws
off the data rendering.. please suggest.Adobe Newsbot hopes that the following resources helps you.
NewsBot is experimental and any feedback (reply to this post) on
its utility will be appreciated:
Flex 3 - Handling service results:
Flex interprets the XML data that a web service or HTTP
service returns to ..... a DataGrid control with DataTable data
returned from a .NET web service.
Link:
http://livedocs.adobe.com/flex/3/html/data_access_6.html
Flex cookbook beta - Building Flex Applications with SOAP Web
Services:
Mar 3, 2008 ... If you are using web services technologies
then it is usually ... The DataGrid tag instanciates an instance of
the DataGrid Flex control.
Link:
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postI d=7863
Flex 3 - Using WebService components:
The Flex web service API generally supports Simple Object
Access Protocol (SOAP) ... property of a DataGrid control and
displayed in the DataGrid control.
Link:
http://livedocs.adobe.com/flex/3/html/data_access_3.html
Adobe - Flex General Discussion:
Flex datagrid data column / webservice - justneed2know -
08/27/2008 ... I use a web service to populate a datagrid and its
columns (on of which is date).
Link:
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=585&threadid =1388794&enterthread=y
All Classes (Flex 3):
mx.rpc.soap, AbstractWebService is an abstract base class for
implementations that provide RPC access to SOAP-based web services.
Link:
http://livedocs.adobe.com/flex/3/langref/class-summary.html
Adobe - Developer Center : Using Flex Builder to Create Web:
Using Flex Builder to Create Web ServiceBased Flex
Applications ... The web service result data needs to flow to the
DataGrid. Select the 'Data will flow
Link:
http://www.adobe.com/devnet/flex/articles/flexbuilder_ws_04.html
Disclaimer: This response is generated automatically by the
Adobe NewsBot based on Adobe
Community
Engine. -
Column Problems Between Explorer and Firefox
First, I apologize if this is something that has been posted.
The search function doesn't seem to be working, so I've been unable
to check for previous posts on-point.
I am having trouble with the columns in a table layout on a
site I am designing. It's located at
www.staggsmarketing.com/fleishell.html. The columns render properly
in firefox, but not at all so in Explorer. If you view the Explorer
version, the problem is quite obvious, so I won't explain further.
If anyone can take a look at the site and suggest what I've
done wrong, I would appreciate it. It was designed in CS3, and I've
run all the standard dreamweaver tests (from the results tab) to no
avail.
Thanks in advance!> As to Walt's apparent suggestion that it's a total
mistake to rely on DW
> without extensive HTML/CSS knowledge, I hope nobody else
is scared away
> from DW
> after reading it.
Walt's suggestion was right on target. Using DW with no
knowledge of HTML
will always produce sub-optimal results.
> I've designed maybe 4 to 5 dozen sites with DW and only
a
> scintilla of coding knowledge compared to many of the
folks on these
> forums,
> and I really have only had to deal with three or four of
Walt's blind
> alleys
> (including this one).
You are in blind alleys you do not yet know about. This
philosophy is
short-changing you AND your paying customers.
> Web design is a hobby for me
And your output will always reflect this.
> I recommend it to anyone with an
> "HTML and CSS for Dummies" level of knowledge.
I don't. It will be a continual frustration for them,
especially if they
want to rise above the 'hobby' level.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"testaggs" <[email protected]> wrote in
message
news:[email protected]...
> Alan, thanks -- I took a look at the path you were
talking about, and it's
> a
> leftover from something before I put the site online. I
am able to remove
> it
> without issue. Still doesn't fix the column problem; I
may take Walt's
> advice
> and start over on the columns if I don't get any
more-helpful posts on the
> problem, but I'll wait a few days to see what others
might suggest. The
> few
> times I've run into real problems before in DW, it's
always been a simple
> fix
> that was just outside my skillset. I'm hoping someone
sees that here and
> says,
> "You idiot, it's the ???? tag."
>
> As to Walt's apparent suggestion that it's a total
mistake to rely on DW
> without extensive HTML/CSS knowledge, I hope nobody else
is scared away
> from DW
> after reading it. I've designed maybe 4 to 5 dozen sites
with DW and only
> a
> scintilla of coding knowledge compared to many of the
folks on these
> forums,
> and I really have only had to deal with three or four of
Walt's blind
> alleys
> (including this one). I agree it's a great tool for
those with good
> coding
> knowledge; but even with only an introductory level of
coding knowledge,
> I've
> found it to be a fantastic program. Would I be better if
I had that
> knowledge?
> Yes, loads. Would I be able to design anything with my
current coding
> skills
> but WITHOUT DW? Not even a one-line blank page (that's
an exaggeration,
> but
> you see the point). Web design is a hobby for me, and DW
has been a
> great
> vehicle to help me make it a useful one. I recommend it
to anyone with an
> "HTML and CSS for Dummies" level of knowledge.
> -
Problem with Datagrid itemrenderer with a Datagrid
Hi all,
I have this kind of a structure. I try to use a datagrid item renderer in a data grid column. However when I try to move rows inside the same datagrid I experience a problem. When my datagrid loads first it seems correct, but when I drag and drop a row in the same datagrid inner datagrids start to be drew in wrong rows. I checked the DB but there are no mistakes in DB records. Problem is with rendering. I suppose inner datagrids trying to draw to early or datagrid component is trying to reuse the itemrenderer. I could not find any solutions for that. Any help will be greatly appreciated..
<mx:DataGridColumn width="130" editable="false"
headerText="{resourceManager.getString('resources', 'acl.content')}">
<mx:itemRenderer>
<mx:Component>
<ACLInnerDataGrid rowCount="3" dragEnabled="true" dropEnabled="false"
x="0" y="0" editable="true" dragInitiatorId="catGrid"
filterGroupName="content" remoteDestination="zend"
remoteSource="ACLFilterParamService" showHeaders="false"
creationComplete="this.init();">
<columns>
<mx:DataGridColumn dataField="id" editable="false" visible="false"/>
<mx:DataGridColumn dataField="ruleId" editable="false" visible="false"/>
<mx:DataGridColumn dataField="filterKey" editable="false" visible="false"/>
<mx:DataGridColumn dataField="param" editable="false" visible="false"/>
<mx:DataGridColumn dataField="name" editable="true"/>
</columns>
</ACLInnerDataGrid>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
Thanks in advance.I have attached the item renderer component source code.
-
Datagrid itemrenderer & evaluation of different column
Hey All,
I've been playing with this for a while but can't get it right. Basically, I have an itemrenderer that has an image and label, but I need to see what the value is of a different column before I know what image to use. I have a feeling the reason why my intended logic won't work is becasue the data[] does not reporesent the whole data structure...but I could be wrong.
This is what I have now:
I have a grid that references this itemrenderer & the grid dataprovider is an array collection:
Form
<s:GridColumn dataField="employee" headerText="Employee"
itemRenderer="com.mycompany.view.assets.renderers.EmployeeStatusColour"></s:GridColumn>
Item Renderer
<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
....>
<fx:Script>
<![CDATA[
override public function prepare(hasBeenRecycled:Boolean):void {
//THIS WORKS BUT NEED TO ADD LOGIC
lblData.text = data[column.dataField];
statusImage.source = "com/mycompany/view/assets/images/dot_GREEN.png";
//THIS IS WHAT I WANT INSTEAD - SYNTAX BELOW IS WRONG BUT YOU'LL GET THE IDEA
lblData.text = data[column.dataField];
if(data[column(3)]; = "MONDAY"{
statusImage.source = "com/mycompany/view/assets/images/dot_GREEN.png";
}else{
statusImage.source = "com/mycompany/view/assets/images/dot_BLUE.png";
]]>
</fx:Script>
<s:HGroup verticalAlign="middle" height="100%" gap="2">
<s:Image id="statusImage"/>
<s:Label id="lblData" paddingTop="5"/>
</s:HGroup>
</s:GridItemRenderer>
Thanks in advance to anybody who can direct me to a solution.
FlexHi,
I tried your suggestion but it didn't work. Thanks though!
However, if you see the code below this works as I stated above. data[column.dataField] returns the value of the referenced value.
override public function prepare(hasBeenRecycled:Boolean):void {
lblData.text = data[column.dataField];
statusImage.source = "com/mycompany/view/assets/images/dot_green.png";
So I did a debug inside my item renderer and found that the data object had all the object values of the row from my grid, which is what I want. I just don't know how to access them individually to do my comparison. It's probably something really easy like
If (data[column(4).dataField]=="MONDAY"){
statusImage.source = "com/mycompany/view/assets/images/dot_GREEN.png";
I know I'm close just don't know the syntax.
Thanks! -
Datagrid itemRenderer - Help needed
I am having trouble getting this little bit of code working. I am trying to build an adhoc SQL generator, where the user selects the list of fields and then is able to set the WHERE criteria in a dataGrid, each row has field, criteria (ComboBox -equals, less than, etc), Low (editable), High (editable-Text or ComboBox lookup), AND/OR static ComboBox. Some of the field selections could be regular text based fields like Name and other fields selected could be lookup fields like State. I would like to be able to on rows that are TextInput render out a TextInput for LowValue and HighValue columns and for lookup fields render out a ComboBox with the dataProvider being set by a call to addComboData.
addComboData simply uses the myDataGrid.selectedItem.fieldname to determine which of the lookup table to use and assigns that collection to CBoxdataProvider. Seems simple enough but I have not been able to figure it out, some modifications seem to work, but only for a single dg cell others give me a list but does not populate lowValue but kill all other renderers. All help is appreciated.
<mx:DataGridColumn headerText="Low" rendererIsEditor="true" editorDataField="selectedItem" dataField="lowValue" textAlign="center">
<mx:itemRenderer>
<mx:Component>
<mx:HBox horizontalScrollPolicy="off" verticalScrollPolicy="off" horizontalAlign="center">
<mx:ComboBox initialize="outerDocument.addComboData()" dataProvider="{ outerDocument.CBoxdataProvider }" labelField="Description" textAlign="left" visible="{data.showCombo}" />
<mx:TextInput id="lowLabel" visible="{!data.showCombo}" />
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>Setting the selected item is not the same as a click. If you created the renderer correctly the style should change when you actually click on the item. (Does it?)
Or are you just trying to get the first row's background to be a different style when the datagrid first shows? (Initialization problem or not working at all?) -
Datagrid itemRenderer/itemEditor trouble
I have a datagrid in a Flex project, the data grid has an XML file as the source (contents below), now due to the way it is formatted (I cannot change this) some of the data I want to display is inside a tag that isnt at the initial array level. Here is the file:
<?xml version="1.0" encoding="utf-8" ?>
<Categories>
<Category>
<CategoryName>Cat 1</CategoryName>
<CategoryLink>http://www.google.com</CategoryLink>
<CategoryData>
<CategoryDescription>This is the description of category 1</CategoryDescription>
<CategoryHeader>My Category Title 1</CategoryHeader>
<CategoryNumber>1</CategoryNumber>
</CategoryData>
</Category>
</Categories>
I need to display CategoryName, CategoryLink, CategoryData.CategoryDescription, CategoryData.CategoryNumber.
Now I blindly dropped the datagrid into the project and bound it to the data source, I get the following returned for CategoryData:
[object CategoryData_type]
Not much use, but with what appears to be a hack I changed the code for the column to read dataField="CategoryData.CategoryDescription", and hooray it works. I didnt realise at the time that this was wrong, and when I dropped in an itemEditor things went wrong. When the datagrids load they display the correct data, but then when you try to edit any of the child property fields you get the following error:
ReferenceError: Error #1069: Property CategoryData.CategoryDescription not found on valueObjects.Category_type and there is no default value.
I have looked up the error and I realise that it means that there is no value for CategoryData.CategoryDescription, but if I can display it why can i not edit it! What do I have to do to make this work?
Anyway, here is the code, it shows the default bound datagrid, a second datagrid with the hack applied, and a third hacked datagrid with an itemRenderer and itemEditor on the number columns
Can you please take a look and tell me what I did wrong, well more to the point, if there is a doc that explains how to deal with XML like this then please point me at it.
I did try changing the return type for ANY of the columns, but this fails, I also tried a labelFunction, but again I can get the [object CategoryData_type] to display, but I get the null reference exception as the datagrid loads if I try to get to the child props.
Here is the Flex code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:categories="services.categories.*"
minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
getDataResult.token = categories.getData();
protected function lftest(item:Object, column:GridColumn):String
var t:String = item.CategoryData;
return t;
]]>
</fx:Script>
<fx:Declarations>
<s:CallResponder id="getDataResult"/>
<categories:Categories id="categories"
fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
showBusyCursor="true"/>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:DataGrid id="dataGrid" x="10" y="10" width="684"
creationComplete="dataGrid_creationCompleteHandler(event)" editable="true"
requestedRowCount="4">
<s:columns>
<s:ArrayList>
<s:GridColumn width="100" dataField="CategoryName" headerText="CategoryName"></s:GridColumn>
<s:GridColumn width="100" dataField="CategoryLink" headerText="CategoryLink"></s:GridColumn>
<s:GridColumn width="180" dataField="CategoryData" headerText="CategoryData"></s:GridColumn>
</s:ArrayList>
</s:columns>
<s:typicalItem>
<fx:Object CategoryData="CategoryData1" CategoryLink="CategoryLink1"
CategoryName="CategoryName1"></fx:Object>
</s:typicalItem>
<s:AsyncListView list="{getDataResult.lastResult}"/>
</s:DataGrid>
<s:DataGrid id="dataGrid2" x="10" y="147" width="684" editable="true" requestedRowCount="4">
<s:columns>
<s:ArrayList>
<s:GridColumn width="100" dataField="CategoryName" headerText="CategoryName"></s:GridColumn>
<s:GridColumn width="100" dataField="CategoryLink" headerText="CategoryLink"></s:GridColumn>
<s:GridColumn width="180" dataField="CategoryData" headerText="CategoryData"></s:GridColumn>
<s:GridColumn dataField="CategoryData.CategoryDescription" headerText="Desc"></s:GridColumn>
<s:GridColumn dataField="CategoryData.CategoryHeader" headerText="Head"></s:GridColumn>
<s:GridColumn dataField="CategoryData.CategoryNumber" headerText="Num"></s:GridColumn>
</s:ArrayList>
</s:columns>
<s:typicalItem>
<fx:Object CategoryData="CategoryData1" CategoryLink="CategoryLink1"
CategoryName="CategoryName1"></fx:Object>
</s:typicalItem>
<s:AsyncListView list="{getDataResult.lastResult}"/>
</s:DataGrid>
<s:DataGrid id="dataGrid3" x="10" y="284" width="684" editable="true" requestedRowCount="4">
<s:columns>
<s:ArrayList>
<s:GridColumn width="100" dataField="CategoryName" headerText="CategoryName"></s:GridColumn>
<s:GridColumn width="100" dataField="CategoryLink" headerText="CategoryLink"></s:GridColumn>
<s:GridColumn width="180" dataField="CategoryData" headerText="CategoryData"></s:GridColumn>
<s:GridColumn headerText="Number">
<s:itemRenderer>
<fx:Component>
<s:GridItemRenderer>
<s:NumericStepper value="{data.CategoryData.CategoryNumber}" />
</s:GridItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:GridColumn>
<s:GridColumn dataField="CategoryData.CategoryNumber" headerText="Number">
<s:itemEditor>
<fx:Component>
<s:GridItemEditor>
<s:NumericStepper value="{data.CategoryData.CategoryNumber}" />
</s:GridItemEditor>
</fx:Component>
</s:itemEditor>
</s:GridColumn>
</s:ArrayList>
</s:columns>
<s:typicalItem>
<fx:Object CategoryData="CategoryData1" CategoryLink="CategoryLink1"
CategoryName="CategoryName1"></fx:Object>
</s:typicalItem>
<s:AsyncListView list="{getDataResult.lastResult}"/>
</s:DataGrid>
</s:Application>
All and any advice welcome.
ShaineOne last try, I now know for sure that the data in the file is loading, I created a labelFunction on the CategoryDescription column that looks like this:
protected function dispData(item:Object, column:GridColumn):String
var t:Object = item.CategoryData;
var s:String = item.CategoryData.CategoryDescription;
return s;
Because it returns s, which I now know is undefined (which is the problem!) I managed to get a debug output. As you can see the value of t is the categorydata, and it appears to have the 3 values I need to get access to, but I have no idea how to do this. I also changed the function to read:
protected function dispData(item:Object, column:GridColumn):String
var t:Object = item.CategoryData;
var s:String = t.CategoryDescription;
return s;
But this undefines t and s! Very confused
this test2 (@d2e10a1)
item valueObjects.Category_type (@91f8a51)
[inherited]
column spark.components.gridClasses.GridColumn (@d61b239)
t valueObjects.CategoryData_type (@91f8c11)
[inherited]
_cacheInitialized_isValid false
CategoryDescription "This is the description of category 1"
CategoryHeader "My Category Title 1"
CategoryNumber "1"
_changedObjects mx.collections.ArrayCollection (@d5d9e41)
_changeWatcherArray [] (@cfab061)
_dminternal_model _CategoryData_typeEntityMetadata (@d4286a1)
_doValidationCacheOfCategoryDescription null
_doValidationCacheOfCategoryHeader null
_doValidationCacheOfCategoryNumber null
_doValidationLastValOfCategoryDescription null
_doValidationLastValOfCategoryHeader null
_doValidationLastValOfCategoryNumber null
_internal_CategoryDescription "This is the description of category 1"
_internal_CategoryHeader "My Category Title 1"
_internal_CategoryNumber "1"
_invalidConstraints [] (@ca50fd9)
invalidConstraints_der <setter>
_isValid false
isValid_der <setter>
managingService <setter>
_managingService null
_model _CategoryData_typeEntityMetadata (@d4286a1)
_validationFailureMessages [] (@cfab0b1)
s undefined
As always all help welcome.
Shaine
Message was edited after a oops moment by: ProcessEndNow -
Datagrid itemRenderer custom component formatting
OK, so this is my first attempt at an itenRenderer. This works below, but I have to imagine there is an easier way. There is also a problem with below, where the changed field (datafield=side) after the itemRenderer is applied, the text is all out of format, and there is a kind of selection on row one of that column. Obvisouly, though the translation is happening, I'm either overidding the wrong thing, or I'm doing something totally wrong.
Goal..... Show in the datagrid, the three colums below from date provided from elsewhere. (This all works), but in the 'side' data it comes in, in raw form as either an 'a' or 'b' or 'both', and I'm trying to display that as something more user friendly. So when both is read it changes it to 'No'.
Any help. This seems really easy, though I can't understanading hy my custom function screws with the cell selection, and formating?
---Main program---
<mx:DataGrid x="10" y="9" width="199" height="147" id="gdimmer_checkChannel" dataProvider="{ current_rack.getItemAt(0).rackLevels }"
change="dimmerCheckCurrentSelection(event);"
sortableColumns="false"
selectedIndex="{ current_rack.getItemAt(0).currentCheckIndex }" >
<mx:columns>
<mx:DataGridColumn headerText="UDN" dataField="udn"/>
<mx:DataGridColumn headerText="DD" dataField="side" editable="false" itemRenderer="renderers.DataGridDDSide"/>
<mx:DataGridColumn headerText="Circuit" dataField="circuit"/>
</mx:columns>
</mx:DataGrid>
--- Component Below ---
<?xml version="1.0" encoding="utf-8"?>
<s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
focusEnabled="true">
<s:Label id="lblData" text="{dataGridListData.label}" />
<fx:Script>
<![CDATA[
override public function set data(value:Object):void
if (value.side == 'both') { lblData.text = " No" };
if (value.side == 'a') { lblData.text = " a" };
if (value.side == 'b') { lblData.text = " b" };
]]>
</fx:Script>
</s:MXDataGridItemRenderer>See the latest post on my blog. You also need to set super.data in the data
setter.
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui -
DataGrid Horizontal Scroll Problem when datagrid contains Item renderer
I have datagrid with horizontal scroll policy enabled. Grid
contains some item renderer also.One of the item renderer is
datefield when i select a date from the datefield and say the
adjacent cell of the grid also contain datefield itemrenderer
and i am selecting date from that itemrenderer also.When i
scroll horizontally the date in the itemrender changes to any one
of the two itemrenderer.Some time it works fine.I am getting the
issue for combobox itemrender also.Can any one help me to solve
this issue."happybrowndog" <[email protected]> wrote in
message
news:ge11ag$jdo$[email protected]..
>
quote:
Originally posted by:
ravi_bharathii
> I have datagrid with horizontal scroll policy enabled.
Grid contains some
> item
> renderer also.One of the item renderer is datefield when
i select a date
> from
> the datefield and say the adjacent cell of the grid also
contain datefield
> itemrenderer
> and i am selecting date from that itemrenderer also.When
i scroll
> horizontally
> the date in the itemrender changes to any one of the two
itemrenderer.Some
> time
> it works fine.I am getting the issue for combobox
itemrender also.Can any
> one
> help me to solve this issue.
>
> Ravi, I am having a similar problem. I subclass a
TextInput as an
> itemrenderer for a column in a datagrid. My subclassed
TextInput checks
> to see
> the value in the overriden set() method, and depending
on the value, sets
> the
> background color of the TextInput to green. When the
datagrid scrolls
> horizontally, some unrelated cell colors also change
green and some of the
> data
> gets duplicated in the cells. The underlying data
provider's data is not
> confused however. Seems the rendering is screwed up when
the Datagrid
> scrolls.
>
> Did you find a solution to this problem? I think
Datagrid is a piece of
> screwed up code.
http://www.magnoliamultimedia.com/flex_examples/Amys_Flex_FAQ.pdf
Q2 -
Ellipsis (...) in dataGrid itemRenderer
If you want a line of text in a datagrid cell to end with an ellipsis (...) when it's too long for its cell, you can set the column's item renderer to be "mx.control.Label" and that works. The entry looks like this:
Here is my line of dat...
But here's my problem.
I have created my own item renderer which is an HBox containing an image and a label. But the label doesn't truncate with the ellipsis ... when the data is too long, it simply chops the end off the displayed text.
So my question is this. How can I get the ellipsis ... to appear for the label in my item renderer? I'm using a datagrid with scaleable column widths so I can't set a fixed width on the label which would work, I know.
Cheers,
NeilThanks for your suggestion.
It didn't work but inspired me to play around with minWidth and maxWidth.
What I eventually got to work was:
maxWidth="
{this.width-28}"
...on the Label in the HBox. I'm assuming that "this" here refers to the ItemRenderer.
I had to put in the "-28" bit or it wouldn't do it. If you want more padding on the right of the ellipsis (so it doesn't hit the edge of the cell) increase the 28 to something higher. Use a lower value for less padding.
Hope this helps someone else like it did me.
Cheers,
Neil
Maybe you are looking for
-
Bapi for vendor opening balances
Hi All, Can I use the bapi " BAPI_AP_ACC_GETOPENITEMS " to get the vendor opening balances? Thanks n Regards, Murali Krishna T
-
Using a Composite Application via a Web Dynpro UI in CE 7.1
Hi Experts, I know how to create a UI using Web Dynpro Java Component and build the Business Logic using Composite Application DC. How do i link them?????? I am using CE 7.1. Cheers Gaurav raghav
-
Install Tarantella EE 3.3 on Solaris 9
Hi, i have one Tarantella 3.3 installation on solaris 8. I would like to move the Tarantella 3.3 installation on solaris 9. tarantella EE 3.3 will support solaris 9.0? is there any know issues with that. Please advice. Thanks in advance, Martin Paul
-
Converting Catalogs From Photoshop Album (2.0) to Photoshop Elements 13
My Photoshop Album currently holds some 23,000 photographs/jpgs from 2003 to date. Each is catalogued to provide a very high level of granularity to assist in identifying specific photographs and their subject content. I have purchased Photoshop Elem
-
How do I make Preview the default instead of Adobe Reader?
When Adobe Reader is installed it makes itself the default and then doesn't provide you anyway to change it that I know of. I tried uninstalling Adobe Reader but then realized that that is the only way to view PDFs from a web browser and therefore ha