Display item renderer in only some rows of a datagrid
I need to display a combobox item renderer in my datagrid
only in the first of every 5 rows. With the remaining 4 rows in
this particular column empty. Then the pattern will repeat again.
This is how I am currently creating the columns however with
this approach the combobox itemrenderer is appearing in all rows
<mx:columns>
<mx:DataGridColumn headerText="No."
dataField="assCriteriaNum" width="60" />
<mx:DataGridColumn headerText="Assessment Criteria"
dataField="assCriteria" width="210"/>
<mx:DataGridColumn headerText="Mark Range"
dataField="markRange" width="50" />
<mx:DataGridColumn headerText="Mark" dataField="mark"
width="70" >
<mx:itemRenderer>
<mx:Component>
<mx:ComboBox>
<mx:dataProvider>
<mx:ArrayCollection>
<mx:String>0</mx:String>
<mx:String>1</mx:String>
<mx:String>2</mx:String>
<mx:String>3</mx:String>
<mx:String>4</mx:String>
<mx:String>5</mx:String>
<mx:String>6</mx:String>
<mx:String>7</mx:String>
<mx:String>8</mx:String>
<mx:String>9</mx:String>
<mx:String>10</mx:String>
</mx:ArrayCollection>
</mx:dataProvider>
</mx:ComboBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
Here is my data provider hard coded
<mx:dataProvider>
<mx:ArrayCollection>
<mx:Array>
<mx:Object assCriteria="A01 Manage." />
<mx:Object assCriteriaNum="1" assCriteria="Brief project
plan, with little evidence of monitoring progress of project work
against the project plan." markRange="(1-3)" />
<mx:Object assCriteriaNum="2" assCriteria="Limited
identification of the topic to be investigated/ researched and
limited evidence of appropriate aims and objectives, and proposed
project title." markRange="(1-3)" />
<mx:Object assCriteriaNum="3" assCriteria="Project plan,
with some evidence of monitoring progress of project work against
the project plan." markRange="(4-6)" />
<mx:Object assCriteriaNum="4" assCriteria="Some
identification of the topic to be investigated/ researched and some
evidence of appropriate aims complete the work and objectives, and
proposed project title." markRange="(4-6)" />
<mx:Object assCriteriaNum="5" assCriteria="Detailed
project plan, with clear evidence of monitoring progress of project
work against the project plan." markRange="(7-10)" />
<mx:Object assCriteriaNum="6" assCriteria="Clear
identification of the topic to be investigated/ researched and
clear evidence of appropriate aims identify the topic and
objectives, and proposed project title." markRange="(7-10)" />
<mx:Object assCriteriaNum="7" assCriteria="No relevant
response." markRange="(0)" />
<mx:Object assCriteria="A02 Use resources/research."
/>
<mx:Object assCriteriaNum="8" assCriteria="Little or no
analysis and application of the research, with few links made to
appropriate theories and concepts." markRange="(1-5)" />
<mx:Object assCriteriaNum="9" assCriteria="Evidence of
limited research involving limited selection and evaluation of
sources." markRange="(1-5)" />
<mx:Object assCriteriaNum="10" assCriteria="Some analysis
and application of the research, with links made to appropriate
theories and concepts." markRange="(4-6)" />
<mx:Object assCriteriaNum="11" assCriteria="Evidence of
some research involving the selection analyse data and evaluation
of a range of relevant sources." markRange="(4-6)" />
<mx:Object assCriteriaNum="12" assCriteria="Critical
analysis and application of the research, with obtain and select
clear links made to appropriate theories and information from a
concepts. variety of sources." markRange="(7-10)" />
<mx:Object assCriteriaNum="13" assCriteria="Evidence of
detailed research involving the selection and evaluation of a wide
range of relevant sources." markRange="(7-10)" />
<mx:Object assCriteriaNum="14" assCriteria="No relevant
response." markRange="(0)" />
</mx:Array>
</mx:ArrayCollection>
</mx:dataProvider>
Similar Messages
-
Download link for only some rows
Hi,
I have 2 tables. One contains records for products, and the other contains images for only some of the products. The images have been uploaded through the application and therefore are in a 'upload_data' table.
The tables are linked by product_id.
I would like to display a report that shows all the column from the products table and a download link for only those products that have an image.
So far the query only returns those rows that have an image.
Thanks
Edited by: user12970007 on 20-Apr-2010 17:59What does this query look like?
-
Number of Rows, displaying a table with only one row
Hello,
I am doing my first VC tests on the discovery System.
I have an input form where I put in the username, then choose a user from a table and with the user ID I want to show the user details in another table.
Now since I am only pickling one user, the new table will only have one row. In VC I cannot set the no. of rows to 1 though, since I cannot edit the no. of rows field. I also cannot disable the scroll buttons.
Why is that?
Is there another way to display user details? I tried to display it in read-only form, but it is pretty ugly.
Another question regarding designing in VC:
Are there any design elements in VC for example to group form fields that belong together? Let's say I have street name, number, postal code and so on, could I use a design element to group them under the label "Address" ?Peter,
For some reason the No. of Rows and Scroll Buttons options are only available if your compiler is set to Web DynPro. Whenever you compile to Flash they're disabled.
Regards
Hennie -
How to edit only some rows in ALV
Hi Experts,
I have editable ALV. I need to allow edit only for some rows, not generaly all of them.
Do you have any idea how to do it?
I use ALV through FM module REUSE_ALV_GRID_DISPLAY.
Thenks®ards,
JirkaHi,
You need to use events. Sample code from sdn.
TYPE-POOLS:SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA:IT_EVENTS TYPE SLIS_T_EVENT.
data: begin of it_chg occurs 0,
index type sy-tabix,
end of it_chg.
DATA: X_EVENTS TYPE SLIS_ALV_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
NAME(10) TYPE C,
ZTERM TYPE C,
END OF ITAB.
PERFORM FILL_TABLE.
loop at itab where zterm = 'A'.
it_chg-index = sy-tabix + 3.
" addition 3 IS FOR FIELD LABELS
append it_chg.
clear it_chg.
endloop.
DATA:L_POS TYPE I VALUE 1.
CLEAR: L_POS.
L_POS = L_POS + 1.
**fieldcatalog
X_FIELDCAT-FIELDNAME = 'NAME'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-FIELDNAME = 'ZTERM'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
**events
REFRESH:IT_EVENTS.
CLEAR:X_EVENTS,IT_EVENTS.
X_EVENTS-NAME = SLIS_EV_END_OF_LIST.
X_EVENTS-FORM = 'MODIFY_LIST'.
APPEND X_EVENTS TO IT_EVENTS.
CLEAR X_EVENTS.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IT_FIELDCAT = IT_FIELDCAT
IT_EVENTS = IT_EVENTS
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*& Form FILL_TABLE
text
FORM FILL_TABLE.
ITAB-NAME = 'vijay'.
ITAB-ZTERM = 'A'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'ABC'.
ITAB-ZTERM = 'B'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'TEST'.
ITAB-ZTERM = 'C'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'DILIP'.
ITAB-ZTERM = 'D'.
APPEND ITAB.
clear itab.
ITAB-NAME = '123'.
ITAB-ZTERM = 'E'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'GEN'.
ITAB-ZTERM = 'A'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'ALV'.
ITAB-ZTERM = 'F'.
APPEND ITAB.
clear itab.
ITAB-NAME = 'ALVTEST'.
ITAB-ZTERM = 'A'.
APPEND ITAB.
clear itab.
ENDFORM. "FILL_TABLE
*& Form MODIFY_LIST
text
FORM MODIFY_LIST.
data: l_lines type i.
describe table itab lines l_lines.
L_LINES = L_LINES + 3.
"because we have 3 lines extra occupied by lables.
"if we have header,i mean top of page add the no.of lines
"how many ever top of page have + 3 for labels.
DO L_LINES TIMES.
read table it_chg with key INDEX = sy-index.
if sy-subrc = 0.
**This code is for reading the out put line
**and modify accordinlg to our requiremnet.
**don't chnage this.
READ LINE SY-INDEX INDEX SY-LSIND.
IF SY-SUBRC = 0.
MODIFY LINE SY-INDEX INDEX SY-LSIND
FIELD FORMAT ITAB-NAME INPUT.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. "MODIFY_LIST -
Restricting rights to modify only some rows
Hi,
I just discovered HTML DB and played around with it on myhtmldb.com because htmldb.oracle.com is down for some reason.
Is there a way to restrict write access to some rows of a table for each user? For example everybody can see the whole table but you can only add/delete/modify the rows where your id/company name/.. is present in one column.
Cheers
MathiasHi,
I just discovered HTML DB and played around with it
on myhtmldb.com because htmldb.oracle.com is down for
some reason.
Is there a way to restrict write access to some rows
of a table for each user? For example everybody can
see the whole table but you can only
add/delete/modify the rows where your id/company
name/.. is present in one column.
Cheers
Mathias -
Hi,
I wonder if anybody could help me in my problem?
I made a table and would like only some of the rows to be selectable. Is this possible?
The best solution would be to hide those squares on the left of the rows.
Thanks in advance for your help.
Piotrek
Edited by: Piotr Kondratowicz on Feb 10, 2009 4:29 PMHi Piotr,
Create a value attribute of type boolean(Ex: ed) and assign it to all editable fields of the table.
Based on a condition enable(ed=true)/disable(ed=false) the row fields as read only.Which will fulfill your requirement.
Thanks & Regards,
Jhansi Miryala -
Counting only some rows without where or subqueries?
Is it possible with oracle to count only some of the rows? I mean without excluding the rows in where or using sub queries.
This does not work but I think it illustrates what I want:
SELECT count(flags), count(flags like '%P%'), count(flags like '%F%') FROM table WHERE some_column = 2;
Where the first would return the number of flags rows, while the second contet the numbers that have P in them and the third counted the number with F.
Table would be
Flags Some_column
'AFP' 2
'A* 1
'PF' 1
'P' 2
And so on.
In postgres you can do: count(substring(flags from 'R')), to achieve the above mentioned idea. Does oracle have a way of doing the same?Your requirement is not clear. But.. Is this what you are trying to achieve?
SQL> with t
2 as
3 (select 'AFP' st from dual
4 union all
5 select 'A*' from dual
6 union all
7 select 'PF' from dual
8 union all
9 select 'P' from dual
10 )
11 select sum(1) sum1,
12 sum(case when st like '%P%' then 1 else 0 end) sum2,
13 sum(case when st like '%F%' then 1 else 0 end) sum3
14 from t
15 /
SUM1 SUM2 SUM3
4 3 2 -
ALV - how to make selectable only some rows on an ALV?
Hi my problem is:
I have an ALV GRID as output of a report.
I have to make selectable only few rows based on the contents of a field (showed in a column in the ALV).
Is it possible?
Best Regards, VincenzoI did understand, but as i told you there is nothing like that, neither an option nor an event to capture.
Here is the documentation: http://help.sap.com/saphelp_erp2005vp/helpdata/EN/bf/3bd1369f2d280ee10000009b38f889/frameset.htm
Read it and choose what you need and what is in existance. -
CheckBox Item Renderer checks wrong grid row after sorting
I have an advanced Data Grid that has a checkBox ItemRenderer. The underlying object being displayed (Server) in the dataGrid is being bound to the checkBox with a selectedForDeployment:Boolean property.
I had this working just fine until the datagrid is sorted. After the grid is sorted I can click on the checkBox in row 2 and the checkBox in row 8 will be selected for instance. Or in some cases all checkBoxes will become checked. Also, if I have some already checked and then sort, the checkBox will become unchecked.
I have an example of my itemRender below. Any idea on how I can get this to work:
public class CheckBoxRenderer extends CheckBox
override public function set data(value:Object):void {
if(value){
super.data = value;
Server(super.data).addEventListener("setSelectionChanged", valueChange);
this.selected = value.selectedForDeployment;
public function CheckBoxRenderer(){
focusEnabled = false;
BindingUtils.bindSetter(selectionChange, this, "selected");
//this method occurs the checkbox is clicked
public function selectionChange(value:Boolean):void{
trace(value);
this.selected = value;
if(this.data){
this.data.selectedForDeployment = value;
//This method occurs when the selectedForDeployment boolean in the object changes
public function valueChange(event:Event):void{
this.selected = event.target.selectedForDeployment;
/* center the checkbox if we're in a datagrid */
override protected function updateDisplayList(w:Number, h:Number):void
super.updateDisplayList(w, h);
if (listData is DataGridListData)
var n:int = numChildren;
for (var i:int = 0; i < n; i++)
var c:DisplayObject = getChildAt(i);
if (!(c is TextField))
c.x = (w - c.width) / 2;
c.y = (h - c.height) / 2;This usually works for me:
package renderers
import flash.events.Event;
import mx.controls.CheckBox;
public class CheckBoxRenderer extends CheckBox
public function CheckBoxRenderer()
super();
addEventListener(Event.CHANGE, handleChange);
override public function set data(value:Object):void {
if(value){
super.data = value;
selected = value.selectedForDeployment;
private function handleChange(event:Event):void{
data.selectedForDeployment = event.target.selected; -
Make only some rows in a report as links
Hi friends,
I am trying to make some of the rows in a report(The report is using union to take data from multiple tables) as links. For example i am trying to make a row corresponding to "emp" as a link. For this i am trying to use the below code
select dname "c1" from dept where dname='dept5'
union all
select
'<a href=*"javascript:popUp2('
|| '''f?p=&APP_ID.:4:&SESSION.::&DEBUG.::'
|| 'P3_EXAMPLE:'
|| ename
|| ''', 700, 500);'
|| '" >'
|| ename*
|| '</a>'
"c1" from emp where Empno=7839
--remove the '*' from the codeBut i a getting the result as
dept5
<*a href="javascript:popUp2('f?p=19669:4:1768622885363834::NO::P3_EXAMPLE:KING', 700, 500);" >KING</a*>
--remove the '*'
What i need to use to make this row a link.
Thanks,
JeevEnsure that the Display As Column Attribute for the report column is Standard Report Column.
-
Hotspot click for only some rows in ALV grid for a particular column ?
Hi there,
In ALV grid, we can make Hotspot enable for all rows in a specified column
by specifying in the fieldcatalog with Hotspot attribute set as true.
But I want to enable Hotspot only for certain rows in the particular column. I tried with MC_STYLE4_LINK , but I didnt got the required result.
So , how could I achieve that in ALV grid.
Points would be rewarded for helpful answers.
Regards,
Anil .Hi,
You can do it for a column. Please refer to the code snippet below,
DATA : it_fcat TYPE lvc_t_fcat,
wa_fcat LIKE LINE OF it_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'SMMW_ALERTS_ICON_S'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = it_fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
LOOP AT it_fcat INTO wa_fcat.
IF wa_fcat-fieldname = 'STATUS'.
wa_fcat-hotspot = 'X'.
MODIFY it_fcat FROM wa_fcat.
CLEAR wa_fcat.
ENDIF.
ENDLOOP.
CALL METHOD l_obj_alv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'SMMW_ALERTS_ICON_S'
CHANGING
it_outtab = lt_alerts_st
it_fieldcatalog = it_fcat.
In the above replace the structure 'SMMW_ALERTS_ICON_S' with your structure and column 'STATUS' with your desired column.
Hope this helps,
Regards,
Vinodh -
Hi all,
I've a query with more than 500 rows as result. I'm only interested to show the first 50 rows. Did you know any way to prepare the select sentence to do it? I prefer avoid use cursors to do that.
Regards,
dbajugHitesh Nirkhey wrote:
hi
use ROWNUM keyword for fetching first 50 rows
simplest example
select * from emp
where rownum < 5 ;
regards
HiteshROWNUM applies to the rows after they are collected into a result set. Thus, it may, or may not, fulfill the OP's requirements. He still needs to define what he means by "first 5 rows".
http://psoug.org/reference/pseudocols.html
Also see description of ROWNUM in the fine SQL Reference manual -
How to access item renderer from main mxml?
Hi,
I have a datagrid which has item renderer. Code looks like this:
<mx:DataGrid id="newsfeedgrid" width="100%" height="100%" visible="true" verticalScrollPolicy="auto"
verticalGridLines="false" horizontalGridLines="true" horizontalGridLineColor="#E5F0F3" showHeaders="false"
rowHeight="70" wordWrap="true" resizableColumns="false">
<mx:columns>
<mx:DataGridColumn headerText="Image Name" dataField="imgname" width="100">
<mx:itemRenderer>
<mx:Component>
<mx:VBox height="100%" width="100%">
<!-- <mx:Image source="{data.imgname}" height="100%" width="100%"/>-->
<local:SmoothImage source="{'http://localhost/musicbook/attachdoc/'+data.imgname}" height="100%" width="100%"/>
<mx:Text text="{data.fname+' '+data.lname}" fontSize="10" fontWeight="bold" fontFamily="Verdana" color="#3D3636"/>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="Messages" dataField="mymsg" wordWrap="true" resizable="true"
>
<mx:itemRenderer>
<mx:Component>
<mx:VBox verticalScrollPolicy="off" creationComplete="lbl_initialize()">
<!--<mx:HBox width="100%">
<mx:Text text="{data.uname}" width="100%" color="BLUE" fontSize="10" fontWeight="bold"
useHandCursor="true" buttonMode="true" mouseChildren="false"
click="this.outerDocument.userPage('msgFromC onnGrid')"/>
<mx:Text text="{data.actmsg}" width="100%" fontSize="10" fontWeight="bold"
/>
<mx:Text text="{data.secuname}" width="100%" color="BLUE" fontSize="10" fontWeight="bold"
useHandCursor="true" buttonMode="true" mouseChildren="false"
click="this.outerDocument.userPage('msgFromC onnGrid')"/>
</mx:HBox>-->
<mx:Text id="lbl" width="100%"
selectable="true"
link="lbl_link(event);" />
<!--<mx:ControlBar id="cbar">-->
<mx:Spacer height="50%"/>
<mx:HBox width="100%">
<mx:Text text="{data.datetime}" fontSize="7" color="#8B9698"/>
</mx:HBox>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
public var tempsecuname:String;
private function lbl_initialize():void {
/* if(lbl.text=="Pratik is good")
lbl.htmlText="<a href='event:flex.org'>Good</a> is Pratik";
//lbl.htmlText = "For more information on Flex, see <u><a href='event:flex.org'>http://www.flex.org/</a></u>.";
if(data.secuname==null)
tempsecuname = "";
else
tempsecuname=data.secuname;
lbl.htmlText="<a href='event:flex.org'><font color='#2112EF'><b>"+data.uname+"</b></font></a>"+data.actmsg+"<a href='event:flex.org'><font color='#2112EF'><b>"+tempsecuname+"</b></font></a>";
private function lbl_link(evt:TextEvent):void {
Alert.show(evt.toString(), evt.text);
switch (evt.text) {
case "flex.org":
// You clicked the flex.org link.
break;
]]>
</mx:Script>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
Problem currently is since lbl_initialize() function is called on creationComplete of Vbox, output displayed is not expected and when ever i navigate to grid page output gets changed and it is not proper.
I wanted to use text ,lbl, in my main.mxml so that i can assign the value when i am setting data provider.
Please help!!!Thanks for your reply.. overriding set data in fact is a better approach and my half problem is solved but i am still facing some issues. Please find my code below:
<mx:DataGridColumn headerText="Messages" dataField="mymsg" wordWrap="true" resizable="true"
>
<mx:itemRenderer>
<mx:Component>
<mx:VBox verticalScrollPolicy="off" >
<mx:Text id="lbl" width="100%"
selectable="true"
link="lbl_link(event);" />
<!--<mx:ControlBar id="cbar">-->
<mx:Spacer height="50%"/>
<mx:HBox width="100%">
<mx:Text text="{data.datetime}" fontSize="7" color="#8B9698"/>
</mx:HBox>
<mx:Script>
<![CDATA[
import mx.core.Application;
import mx.controls.Alert;
public var tempsecuname:String;
public var tempmsg:String="";
override public function set data( value:Object ) : void {
super.data = value;
lbl.htmlText="<a href='event:data.uname'><font color='#2112EF'><b>"+data.uname+"</b></font></a>"+tempmsg;
if(data.datetime>Application.application.lastlogout)
Alert.show(Application.application.lastlogout);
lbl.setStyle("fontWeight","bold");
private function lbl_link(evt:TextEvent):void {
]]>
</mx:Script>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
Now my text is coming properly with link like how i wanted. I have added here another functionality where I am checking the last logouttime of user and the msg time and if msgtime is greater than last logout time then i am showing it in bold.
override public function set data( value:Object ) : void {
super.data = value;
lbl.htmlText="<a href='event:data.uname'><font color='#2112EF'><b>"+data.uname+"</b></font></a>"+tempmsg;
if(data.datetime>Application.application.lastlogout)
Alert.show(Application.application.lastlogout);
lbl.setStyle("fontWeight","bold");
First time is shows properly but if i scroll then some random row is also appearing in bold, also when ever this set data function is getting called some random rows are coming in bold.
Please let me know your input -
Programmatically selecting some row - selectedItem is null
Hey guys
In my application, I have a datagrid that is bound to RemoteObject. The datagrid has a corresponding form that contains the details. When the user clicks on a row in the datagrid the form populates with the values from the DataGrid's selectedItem.
I want to programatically select some row in my DataGrid when the application loads.
In order to do this, I have to call validateNow() and scrollToIndex()
eg.
dg.selectedIndex = i; dg.validateNow();
dg.scrollToIndex(i);
I put this code in the Applications creationComplete handler.
This all works great - the desired row is highlighted and selected and the selectedIndex is i. The problem is that I can't access the data to populate the details form. When I try to retrieve the dg.SelectedItem property - it is null.
How does one programatically select some row in the grid on load AND access the row data?
thanksHey Alex,
Thanks for your reply.
I have searched this issue from Bug and Issue Management System.I did find a similar bug in <mx:List> ,see SDK-4782,But not Datagrid.I'm using SDK 3.2,is there any way to resolve it? -
Hi again, developers:
I'm in a search of a datagrid with certain characteristics:
- variableRowHeight = "true"
- only one column
- each row must have a custom item renderer with possibly different heights, and a fixed width
- the datagrid must show always every item in the data provider with no vertical scroll bars, what means that the datagrid height must have always the exact height sum of all the item renderers it is displaying.
- and no extra empty rows must appear in the last positions of the datagrid
The last two requirements are something difficult to achieve... for some reason, empty rows appear at the last positions of the datagrid. I post what i've managed to get:
<mx:Script>
<![CDATA[
private function resize():void
if (dg.dataProvider)
var h:Number = dg.measureHeightOfItems( -1, dg.dataProvider.length);
dg.height = h;
]]>
</mx:Script>
<mx:DataGrid id="dg" width="530" horizontalCenter="0" verticalScrollPolicy="off"
dataProvider="{dp}"
wordWrap="true" variableRowHeight="true" showHeaders="false" dataChange="resize()" height="{dg.measureHeightOfItems(-1,dg.dataProvider.length)}" click="Alert.show(dg.rowCount.toString());">
<mx:columns>
<mx:DataGridColumn headerText="ID" width="50">
<mx:itemRenderer>
<mx:Component>
<mx:TextArea height="{Math.random()*100}" wordWrap="true" backgroundColor="{Math.random() * 16777216}" paddingTop="0" paddingBottom="0"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>Thanks Harui, but it doesn't help. If the border is set it will help, but the very big problem is the empty rows that appear at the end of the datagrid... I can't find a way of measuring correctly the height of the itemRenderers!
I'll update this thread if I manage to do it.
Maybe you are looking for
-
Exception_access_violation error on Windows 2000 Professional
Hello, I am developing a stand-alone Java application that runs without any problem on Windows 98, XP, and most 2000 and NT machines. On some Windows 2000 Professional machines, however, attempting to run the program generates the following error. Is
-
I am having problem on my ipad mini 2. I only have one Apple ID, and every time I try to post a review, I get the message "you must have purchased or downloaded this item to write a Customer Review." This problem is with most of the Apps.The applic
-
Mounting NTFS,FAT32 and USB FLASH drive
Problem and problem!! I am going to fade up with Solaris 10. Please somebody help me!! Problem is with mounting my FAT32, NTFS partitions and USB flash drive (twinmos). How can I mount FAT32, NTFS file system and my USB flash drive in Solaris 10??
-
How to get last year records in P&L
Hii gurus, I am creating Profit & Loss report. I need to show last year records. Please explain..... Thanks in advance...... Moderator message: please do more research before asking, show what you have done yourself when asking. Edited by: Thomas Zlo
-
Display external html page in (Collapsible Panel widget)
i everybody is there a way to display external html page in (Collapsible Panel widget) All the example a seen is with raw text in it is the panel can display different object instead of simple text At least a internal designed html page Thanks