Datagrid styling. All even rows blue - odd rows white
Hi.
I have seen a lot of tables where the second row is white and the first is blue. This makes it easier to read the data for a particular students results.
How could that be done - would you have to code it in ie: colour the even rows by targeting the even numbers or is there a built in way.
Cheers
Information:
http://blogs.adobe.com/pdehaan/2007/06/setting_a_flash_data_grids_bac_1.html
http://blogs.adobe.com/pdehaan/2007/06/alternating_background_colors.html
Source Files:
http://blogs.adobe.com/pdehaan/code/section13.example1.zip
http://blogs.adobe.com/pdehaan/code/section12.example1.zip
Similar Messages
-
Split a column based on even and odd rows
Table1
Table2
Col1
Odd
Even
A
A
B
B
C
D
C
E
F
D
G
H
E
I
NULL
F
G
H
I
I am using MS SQL v2005
I want to split a column into two columns : -
one column must have all the odd rows data while the other column must have even rows data
in other words I want the data in Table1 to be displayed as data in Table2.
Col, Odd and Even are column namesIn SQL 2005 wont approach like what I suggested do only a single scan of the table?
A major problem with your solution is that you assume that 1) the values are contiguous 2) they are numeric. Try the below:
CREATE TABLE #t (id INT NOT NULL IDENTITY(1,1), Col1 CHAR(1))
INSERT INTO #t VALUES ('A'),('B'), ('C'),('D'), ('E'),('F'), ('G'), ('H'), ('I')
go
SELECT MAX(CASE WHEN Col1 % 2 > 0 THEN Col1 END),
MAX(CASE WHEN Col1 % 2 = 0 THEN Col1 END)
FROM
SELECT Col1,ROW_NUMBER() OVER (PARTITION BY (Col1 % 2) ORDER BY Col1) AS Rn
FROM #t
)t
GROUP BY Rn
go
; WITH numbering AS (
SELECT Col1, row_number() OVER (ORDER BY Col1) AS rowno
FROM #t
), leading AS (
SELECT Col1 AS odd, LEAD(Col1) OVER(ORDER BY rowno) AS even, rowno
FROM numbering
SELECT odd, even
FROM leading
WHERE rowno % 2 = 1
go
DROP TABLE #t
Erland Sommarskog, SQL Server MVP, [email protected] -
Odd/Even Fields - Removing Pixel Rows In PS
This is hard to explain, but I have a challenging task here in PS. There has to be a way to do this!
I have to make our video engineering dept. two separate files, one containing the EVEN rows of pixels, and one file with the ODD rows of pixels.
BUT, I have to collapse the space between each pixel row, truncating the file height in half.
I have produced two master PSD files now, 854x480 WVGA format. I created a grid of selections (saved as an alpha channel) for ODD rows and EVEN rows, and deleted the unnecessary rows. If you were to layer these two files together, the image would appear seamlessly.
OK, fine. I almost have what I want, but I'm not done yet.
What I have to do now is to remove the space between each pixel row (the transparent rows), truncating the file height to 240 pixels high.
Yes, I know the final image will appear "odd", but this is for technology development purposes.
Can anyone offer a procedure to remove the rows of transparent pixels, resulting in a shorter file height?
I could post a PSD, I suppose, if someone wanted to see what I'm starting with.
If each pixel row were on an individual layer, I could distribute the layers, one on top of the other. But moving each pixel row would mean 240 layers.
There has to be another way.
I'm thinking there might be a method of doing this in AE if I can't do this in PS.
Thanks so much.Tom:
I would process one file at a time, creating even and odd files, as opposed to breaking out two files using masks (as you seem to describe) and then processing those. I'm 95% sure you can action this to a batchable action (serial numbered even/odd files, not filename-prefix, if that makes sense). When creating the 239 dupes: dupe one set, then select both sets, dupe both, then select four, dupe those and so on. Do this in a blank action to make it easy to determine what you're duping. I created an action with 1024 sets of steps this way, which is more than enough to process both even/odd files, link everything, copy merged, save out, etc. If you're using CS3 the linking is much more simple: link layers 1 through 240 selecting all, vs: select layer 1, layer 2, layer 3, ...
If you merge linked and copy to a new file called "odd," then when you batch the action you can create 001_odd.psd, 001_even.psd, 002_odd.psd, 002_even.psd, ... Get the receiver to sign off on receiving renamed files and then no handwork for you. Or bug the scripting folks in that forum and they might be able to help you with naming the resultant files based on original.
J -
How to set different colors for even odd rows in a data table
hi,
In my project i hav a data table. i am using jsf. i want the rows of the data table different colors for even, odd rows. can i do it just setting the row class property ? or there should be there some other way? please help.
sailajoyHope this helps
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title></title>
<style type='text/css'>
.scrollContent {
height:100px;
overflow-x:hidden;
overflow-y:auto;
.scrollContent tr {
height: auto;
white-space: nowrap;
.scrollContent tr td:last-child {
padding-right: 20px;
.fixedHeader tr {
position: relative;
height: auto;
top: expression( this.parentNode.parentNode.parentNode.scrollTop + 'px' );
div.TableContainer {
border: 1px solid #7DA87D;
.headerFormat {
background-color: white;
color: #C8D7B5;
margin: 3px;
padding: 1px;
white-space: nowrap;
font-family: Helvetica;
font-size: 16px;
text-decoration: none;
font-weight: bold;
.headerFormat tr td {
border: 1px solid #C8D7B5;
background-color: #666633;
.bodyFormat tr td {
color: #000000;
margin: 3px;
padding: 1px;
border: 0px none;
font-family: Helvetica;
font-size: 12px;
.alternateRow {
background-color: #C8D7B5;
</style>
<style type="text/css">
div.TableContainer {
height: 121px;
overflow-x:hidden;
overflow-y:auto;
</style>
</head>
<body>
<table cellpadding="0" cellspacing="0" border="0"><tr><td><div id="TableContainer" class="TableContainer" style="height:230px;">
<table class="scrollTable">
<thead class="fixedHeader headerFormat">
<tr class="title">
<td title="Sort" align="center"><b>NAME</b> </td>
<td title="Sort" align="center"><b>Amt</b> </td>
<td title="Sort" align="center"><b>Lvl</b> </td>
<td title="Sort" align="center"><b>Rank</b> </td>
<td title="Sort" align="center"><b>Position</b> </td>
<td title="Sort" align="center"><b>Date</b></td>
</tr>
</thead>
<tbody class="scrollContent bodyFormat" style="height:200px;">
<tr class="alternateRow">
<td>Maha</td>
<td>
<input type="text" name="textfield" size="7" />
</td>
<td align="right"><input type="text" name="textfield2" size="7" /></td>
<td align="right"><input type="text" name="textfield3" size="7" /></td>
<td><input type="text" name="textfield4" size="7" /></td>
<td align="right"><input type="text" name="textfield5" size="7" /></td>
</tr>
<tr>
<td>Thrawl</td>
<td align="right">$9,550</td>
<td align="right">159</td>
<td align="right">100%</td>
<td>Co-Owner</td>
<td align="right">11/07/2003</td>
</tr>
<tr class="alternateRow">
<td>Marhanen</td>
<td align="right">$223.04</td>
<td align="right">83</td>
<td align="right">99%</td>
<td>Banker</td>
<td align="right">06/27/2006</td>
</tr>
<tr>
<td>Peter</td>
<td align="right">$121</td>
<td align="right">567</td>
<td align="right">23423%</td>
<td>FishHead</td>
<td align="right">06/06/2006</td>
</tr>
<tr class="alternateRow">
<td>Jones</td>
<td align="right">$15</td>
<td align="right">11</td>
<td align="right">15%</td>
<td>Bubba</td>
<td align="right">10/27/2005</td>
</tr>
<tr>
<td>Supa-De-Dupa</td>
<td align="right">$145</td>
<td align="right">91</td>
<td align="right">32%</td>
<td>momma</td>
<td align="right">12/15/1996</td>
</tr>
<tr class="alternateRow">
<td>ClickClock</td>
<td align="right">$1,213</td>
<td align="right">23</td>
<td align="right">1%</td>
<td>Dada</td>
<td align="right">1/30/1998</td>
</tr>
<tr>
<td>Mrs. Robinson</td>
<td align="right">$99</td>
<td align="right">99</td>
<td align="right">99%</td>
<td>Wife</td>
<td align="right">07/04/1963</td>
</tr>
<tr class="alternateRow">
<td>Maha</td>
<td align="right">$19,923.19</td>
<td align="right">100</td>
<td align="right">100%</td>
<td>Owner</td>
<td align="right">01/02/2001</td>
</tr>
<tr>
<td>Thrawl</td>
<td align="right">$9,550</td>
<td align="right">159</td>
<td align="right">100%</td>
<td>Co-Owner</td>
<td align="right">11/07/2003</td>
</tr>
<tr class="alternateRow">
<td>Marhanen</td>
<td align="right">$223.04</td>
<td align="right">83</td>
<td align="right">59%</td>
<td>Banker</td>
<td align="right">06/27/2006</td>
</tr>
<tr>
<td>Peter</td>
<td align="right">$121</td>
<td align="right">567</td>
<td align="right">534.23%</td>
<td>FishHead</td>
<td align="right">06/06/2006</td>
</tr>
<tr class="alternateRow">
<td>Jones</td>
<td align="right">$15</td>
<td align="right">11</td>
<td align="right">15%</td>
<td>Bubba</td>
<td align="right">10/27/2005</td>
</tr>
<tr>
<td>Supa-De-Dupa</td>
<td align="right">$145</td>
<td align="right">91</td>
<td align="right">42%</td>
<td>momma</td>
<td align="right">12/15/1996</td>
</tr>
<tr class="alternateRow">
<td>ClickClock</td>
<td align="right">$1,213</td>
<td align="right">23</td>
<td align="right">2%</td>
<td>Dada</td>
<td align="right">1/30/1998</td>
</tr>
<tr>
<td>Mrs. Robinson</td>
<td align="right">$99</td>
<td align="right">99</td>
<td align="right">(-10.42%)</td>
<td>Wife</td>
<td align="right">07/04/1963</td>
</tr>
<tr class="alternateRow">
<td>Maha</td>
<td align="right">-$19,923.19</td>
<td align="right">100</td>
<td align="right">(-10.01%)</td>
<td>Owner</td>
<td align="right">01/02/2001</td>
</tr>
<tr >
<td>Thrawl</td>
<td align="right">$9,550</td>
<td align="right">159</td>
<td align="right">-10.20%</td>
<td>Co-Owner</td>
<td align="right">11/07/2003</td>
</tr>
<tr class="alternateRow" >
<td><strong>TOTAL</strong>:</td>
<td align="right"><strong>999999</strong></td>
<td align="right"><strong>9999999</strong></td>
<td align="right"><strong>99</strong></td>
<td > </td>
<td align="right"> </td>
</tr>
</tbody>
</table>
</div></td></tr></table>
</body>
</html> -
I have a table that is broken into subsections based on a
spry Test Attribute. I am trying to apply even/odd row styles to
the table but it is not displaying properly.
I am assuming that there is a problem with the spry:test
attribute. It seems like it is just hiding the rows which are begin
tested out, and because of that the even odd rows styles are not
displaying properly.
So here a very simplified version of what I have.
<div id="books1" spry:region="dsbooks"
class="SpryHiddenRegion">
<table spry:state="ready">
<tr><th onclick="dsbooks.sort('book');"> Book
Name</th></tr>
<tr><td>Children's books</td></tr>
<tr spry:repeat="dsbooks" spry:test="'{sub}' ==
'children" spry:even="even" >
<td>{book}</td></tr>
<tr><td>Classic Books</td></tr>
<tr spry:repeat="dsbooks" spry:test="'{sub}' == classic'"
spry:even="even" >
<td>{book}</td></tr>
</table></div>
The problem is the page load time is already getting pretty
big.. I am running a lot of scripts and can't afford to break the
table sections into multiple datasets, and I want it to sort across
tables subsections on a single click event. Is there a way get
these to show different even and odd rows properly? I saw a
previous forum which mentioned this problem and alluded to an
answer, but I couldn't find the answer it mentioned. The previous
forum message is
Hereanyone?
-
Blue row color is becoming white when the mouse is over the blue rows
Team,
I am using blue theme. I want to accomplish word wrap in all the columns.
In "Standard, Alternating Row Colors", I have changed the following:
Column Template 1:
<td style="padding-top: 2px; padding-bottom: 2px; padding-left: 5px; padding-right: 5px; border-style: solid;border-width:
1px 1px 1px 1px;width:90pt;word-wrap: break-word;"#ALIGNMENT#>#COLUMN_VALUE#</td>
Column Template 2:
<td style="background-color:#BEE2FD; padding-top: 2px; padding-bottom: 2px; padding-left: 5px; padding-right: 5px;
border-style: solid;border-width: 1px 1px 1px 1px;width:90pt;word-wrap: break-word;"#ALIGNMENT#>#COLUMN_VALUE#</td>
This gave alternate rows white and blue with wrap.
But my blue row color is becoming white when the mouse is over the blue rows. Can any body help?I had the "#6CAAD9" in:
Background color for checked row: "#6CAAD9".
I removed that. But still it didn't work. any help? -
Concatenate all data in one row to all data in the next row
I have been trying to do this, I'm sure simple procedure, with no luck
Table
A B
1 5
2 4
3 3
4 2
5 1
and put all the data from each row into a single cell to look like this
Table
C
1:5, 2:4, 3:3, 4:2, 5:1
I imagine I need to use some kind of recursive formula but not sure how to do that in Numbershoshi,
in C, fill with: =A&":"&B
Very simple.
By the way, nothing recursive will work in Numbers. An error message will be generated if the result of a particular cell depends in any way upon its own content.
Jerry -
How can i get all these values in single row with comma separated?
I have a table "abxx" with column "absg" Number(3)
which is having following rows
absg
1
3
56
232
43
436
23
677
545
367
xxxxxx No of rows
How can i get all these values in single row with comma separated?
Like
output_absg
1,3,56,232,43,436,23,677,545,367,..,..,...............
Can you send the query Plz!These all will do the same
create or replace type string_agg_type as object
2 (
3 total varchar2(4000),
4
5 static function
6 ODCIAggregateInitialize(sctx IN OUT string_agg_type )
7 return number,
8
9 member function
10 ODCIAggregateIterate(self IN OUT string_agg_type ,
11 value IN varchar2 )
12 return number,
13
14 member function
15 ODCIAggregateTerminate(self IN string_agg_type,
16 returnValue OUT varchar2,
17 flags IN number)
18 return number,
19
20 member function
21 ODCIAggregateMerge(self IN OUT string_agg_type,
22 ctx2 IN string_agg_type)
23 return number
24 );
25 /
create or replace type body string_agg_type
2 is
3
4 static function ODCIAggregateInitialize(sctx IN OUT string_agg_type)
5 return number
6 is
7 begin
8 sctx := string_agg_type( null );
9 return ODCIConst.Success;
10 end;
11
12 member function ODCIAggregateIterate(self IN OUT string_agg_type,
13 value IN varchar2 )
14 return number
15 is
16 begin
17 self.total := self.total || ',' || value;
18 return ODCIConst.Success;
19 end;
20
21 member function ODCIAggregateTerminate(self IN string_agg_type,
22 returnValue OUT varchar2,
23 flags IN number)
24 return number
25 is
26 begin
27 returnValue := ltrim(self.total,',');
28 return ODCIConst.Success;
29 end;
30
31 member function ODCIAggregateMerge(self IN OUT string_agg_type,
32 ctx2 IN string_agg_type)
33 return number
34 is
35 begin
36 self.total := self.total || ctx2.total;
37 return ODCIConst.Success;
38 end;
39
40
41 end;
42 /
Type body created.
[email protected]>
[email protected]> CREATE or replace
2 FUNCTION stragg(input varchar2 )
3 RETURN varchar2
4 PARALLEL_ENABLE AGGREGATE USING string_agg_type;
5 /
CREATE OR REPLACE FUNCTION get_employees (p_deptno in emp.deptno%TYPE)
RETURN VARCHAR2
IS
l_text VARCHAR2(32767) := NULL;
BEGIN
FOR cur_rec IN (SELECT ename FROM emp WHERE deptno = p_deptno) LOOP
l_text := l_text || ',' || cur_rec.ename;
END LOOP;
RETURN LTRIM(l_text, ',');
END;
SHOW ERRORS
The function can then be incorporated into a query as follows.
COLUMN employees FORMAT A50
SELECT deptno,
get_employees(deptno) AS employees
FROM emp
GROUP by deptno;
###########################################3
SELECT SUBSTR(STR,2) FROM
(SELECT SYS_CONNECT_BY_PATH(n,',')
STR ,LENGTH(SYS_CONNECT_BY_PATH(n,',')) LN
FROM
SELECT N,rownum rn from t )
CONNECT BY rn = PRIOR RN+1
ORDER BY LN desc )
WHERE ROWNUM=1
declare
str varchar2(32767);
begin
for i in (select sal from emp) loop
str:= str || i.sal ||',' ;
end loop;
dbms_output.put_line(str);
end;
COLUMN employees FORMAT A50
SELECT e.deptno,
get_employees(e.deptno) AS employees
FROM (SELECT DISTINCT deptno
FROM emp) e;
DEPTNO EMPLOYEES
10 CLARK,KING,MILLER
20 SMITH,JONES,SCOTT,ADAMS,FORD
30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
CREATE OR REPLACE FUNCTION concatenate_list (p_cursor IN SYS_REFCURSOR)
RETURN VARCHAR2
IS
l_return VARCHAR2(32767);
l_temp VARCHAR2(32767);
BEGIN
LOOP
FETCH p_cursor
INTO l_temp;
EXIT WHEN p_cursor%NOTFOUND;
l_return := l_return || ',' || l_temp;
END LOOP;
RETURN LTRIM(l_return, ',');
END;
COLUMN employees FORMAT A50
SELECT e1.deptno,
concatenate_list(CURSOR(SELECT e2.ename FROM emp e2 WHERE e2.deptno = e1.deptno)) employees
FROM emp e1
GROUP BY e1.deptno;
DEPTNO EMPLOYEES
10 CLARK,KING,MILLER
20 SMITH,JONES,SCOTT,ADAMS,FORD
30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
CREATE OR REPLACE TYPE t_string_agg AS OBJECT
g_string VARCHAR2(32767),
STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
value IN VARCHAR2 )
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
returnValue OUT VARCHAR2,
flags IN NUMBER)
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
ctx2 IN t_string_agg)
RETURN NUMBER
SHOW ERRORS
CREATE OR REPLACE TYPE BODY t_string_agg IS
STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
RETURN NUMBER IS
BEGIN
sctx := t_string_agg(NULL);
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
value IN VARCHAR2 )
RETURN NUMBER IS
BEGIN
SELF.g_string := self.g_string || ',' || value;
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
returnValue OUT VARCHAR2,
flags IN NUMBER)
RETURN NUMBER IS
BEGIN
returnValue := RTRIM(LTRIM(SELF.g_string, ','), ',');
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
ctx2 IN t_string_agg)
RETURN NUMBER IS
BEGIN
SELF.g_string := SELF.g_string || ',' || ctx2.g_string;
RETURN ODCIConst.Success;
END;
END;
SHOW ERRORS
CREATE OR REPLACE FUNCTION string_agg (p_input VARCHAR2)
RETURN VARCHAR2
PARALLEL_ENABLE AGGREGATE USING t_string_agg;
/ -
My laptops QWERTY row of keys does not work for long periods at random intervals and only after pushing all the buttons on the row does it eventually turn back on and then will still cut out every now and again, anyone know how to solve this? If not is there any way to actually get a genuis appointment lol to get one of them to have a look at the hardware on the keyboard?
Apple Support (formerly ExpressLane):
https://getsupport.apple.com/GetproductgroupList.do
https://getsupport.apple.com/GetSASO?SG=SG001&locale=en_US -
Ordering datagrid rows by dragging rows
Hi all,
I have a normal dg which is pulling data from MySQL db and
i'm trying
to figure out the best way to allow users to drag the rows to
re-order
as per however they may want it..
This is what I thought buy some feedback would be great!
1. Add 'order' column to sql db
2. Set inital order for each row
3. sort by order desc when pulling db into dg
4. Create function to:
a. when a user drops a row into desired position make each
rows
order = each rows index
b. update mysql db when all changes are complete
I also thought, maybe remember oldOrder val, + 1 to each
order value
from point of insertion until order = oldOrder??
Obviously this method has issues when the # of rows grows..
so thats
why I would love some help with this! there must be a better
way :)
Thanks in advance!
Matt (OzFlex Adobe User Group - Melbourne)Hi all,
I have a normal dg which is pulling data from MySQL db and
i'm trying
to figure out the best way to allow users to drag the rows to
re-order
as per however they may want it..
This is what I thought buy some feedback would be great!
1. Add 'order' column to sql db
2. Set inital order for each row
3. sort by order desc when pulling db into dg
4. Create function to:
a. when a user drops a row into desired position make each
rows
order = each rows index
b. update mysql db when all changes are complete
I also thought, maybe remember oldOrder val, + 1 to each
order value
from point of insertion until order = oldOrder??
Obviously this method has issues when the # of rows grows..
so thats
why I would love some help with this! there must be a better
way :)
Thanks in advance!
Matt (OzFlex Adobe User Group - Melbourne) -
Hi
My application is generating a 2-dimensional array of data as it performs multiple sweeps. I would like to take the mean of all the data in each row and thereby reduce to a 1-dimensional array. Does anybody have a quick solution.
(Sorry - I am posting many messages at present, I promise to share my acquired knowledge!!!).
Thanks
Ashley.Try this.
Attachments:
Mean.JPG 5 KB -
Display all rows (starting at row 1)
Hi there
How can I create code (with or without the wizard) in Web Application Designer, that will force the table (analysis web item) to display all rows starting at row 1.
The user is initially presented with a table which is, say, limited to 5 lines at a time. Default scrolling / paging functionality is added, which allows them to page down 5 rows at a time.
I want to be able to provide a button which displays all the rows ... normally this would be done by setting BLOCK_ROW_SIZE to 0 if I am correct.
However, what I have found is that simply setting this parameter, displays all the rows, but from the existing row, so if the user had paged down once already, they are shown rows 6 till the end.
I have played with various combinations of DATA_ROW_FROM, DATA_ROW_TO and BLOCK_ROW_SIZE, and none of those combinations seem to work for me.
I would have thought setting the FROM row to 1, the TO row to 0 and the BLOCK size to 0 would do the trick, but that simply shows all the rows from the current position ... again, I want to go back to the first line and then show all.
Putting 2 commands in the button doesn't seem to work either, as the 2nd command seems to override the 1st command.
Any ideas?
Cheers,
AndrewCome on ... someone must have had to do something like this ...
-
how to make each playlist for each movie songs ? when i tried to add songs all movie songs comes in row , its very difficult to find which movie song belongs?
Thank you! I put some self help hypnosis tracks to listen to on my iPod. I did not want to go to the next track automatically, I wanted to listen to them individually, one at a time. (If I fell asleep, I did not want to 'wake up' in the middle of a different track.) Your information helps me understand that I need to re-load this playlist onto my iPod from my Mac computer, only first, I need to UNCHECK the boxes in front of each track so the iPod will STOP each time after playing the selected track. It is too bad that so many functions are not availabvle within the iPod, but that is probably why they can make it so compact.
-
ADG/DataGrid prevent render even from firing immediately on property
Hi,
Is there any way to tell the ADG to not re-render itself immediately after a
propertyChanged even has been fired in the dataProvider?
I have quite a wide row (lots of cells) and lots of custom logic that updates
these dependent properties on each row. i.e. calculated columns. I am doing the
calculations at dataProvider level vs labelFunctions. On each "set" function of
one of my cells in the row I raise a "propertyChanged" event if the value was
changed. Tracing through what the ADG is doing I'm finding that its re-rendering
each time I raise this event even if its in the same row. Is there any way to
tell the ADG to wait a few milliseconds in case another propertyChanged event
comes in so as to render once instead of 10 times?
If there is no ADG option what is the best pattern for this assuming I want to
do this in my underlying dataprovider objects. Should I raise custom events and
fake a itemUpdated once I know there are no more changes? I don't see a clean
way to do this however since I never really know when I'm done, and using a
timer or something of this nature seems like a major hack.
-Tom
Rest of discussion from FlexCoders ...
Re: ADG/DataGrid prevent render even from firing immediately on propertyChange
You might try enableAutoUpdate and disableAutoUpdate on ICollectionView, not
sure if that has the desired affect or not.
You could also put custom events in your model objects and manually dispatch
collection events or call explicitly tell the grid when to update.
By "explicitly tell the grid when to update" do you mean manually calling
itemUpdated at the View level?. If so does the grid actually "know" to re-render
only that updated row? It seems to me that it always re-rendered all visible
cells regardless of what was changed. So passing null or a real row into
itemUpdated has the same results.
Also if I am to manully dispatch propertyChanged from my row, and I never really
know when I'm done updating all of my dependant cells is there any good way to
do this. i.e. Cell A update cell B and cell B update updates cell E, and this
can go on indefinatley. By catchign all property changed events at Row level and
using a timer of say 50ms i would almost guarantee that I wouldn't rethrow more
than a single propertyChanged event on any of the updated cells in a row. Do you
think there is a better way to do this?
Follow up finding,
Do 10 propertyChanged events from my dataProvider cause grid to refresh once or
10 times? My most recent observations show that it's just once, though for some
reason the first load invokes my labelFunction 3 times. Is there any point in
using enableAutoUpdate if grid appears to be 'smart' enough?>>And what about the the most important question, how exactly is TableAssetsViewSource defined in the XAML markup and what is
its Source property set or bound to? And what about the reproducable sample...?
Here is the Markup of the TableAssetsViewSource:
<Page.Resources>
<local:RETAILISOAMDDataSet x:Key="RETAILISOAMDDataSet"/>
<CollectionViewSource x:Key="TableRegionsViewSource" Source="{Binding tableRegions, Source={StaticResource RETAILISOAMDDataSet}}"/>
<CollectionViewSource x:Key="TableLocationsViewSource" Source="{Binding tableLocations, Source={StaticResource RETAILISOAMDDataSet}}"/>
<CollectionViewSource x:Key="TableAssetsViewSource" Source="{Binding tableAssets, Source={StaticResource RETAILISOAMDDataSet}}"/>
</Page.Resources>
The ItemsSource of the DataGrid is bound to the TableAssetsViewSource:
<DataGrid DataContext="{StaticResource TableAssetsViewSource}" ItemsSource="{Binding}" x:Name="TableAssetsDataGrid" AutoGenerateColumns="False" EnableRowVirtualization="True" Margin="15,10,10,10" RowDetailsVisibilityMode="VisibleWhenSelected" Grid.Column="1" HeadersVisibility="Column" CanUserResizeRows="False" IsReadOnly="True">
Just remember, this code was auto-generated with the drag & drop onto the Page, so I did little in terms of setting the actual bindings.
All in all, what I have done so far works as intended, except that when I want to add a row to the table it does not reflect, and that it only shows after refreshing/restarting the application.
I will try and put together a reproducable sample. -
Change JTable's row color on row selection
Hello!
Everywhere I've looked they're only explaining how to draw rows in different colors WHEN THE TABLE IS BEING CREATED, via prepareRenderer.
But that is not what I am looking for. What I want is to actually change the row's color after the table has been drawn/rendered/whatsoever. For instance, when the user clicks on that row. The default behaviour is for the row to become blueish, but, when the user selects another row, the first selected row turns back to white. I would like to prevent that from happening. I want the row to become FIRE RED when the user clicks on it, and I want the row to remain like that for good, even when the user selects a different row. Do I make any sense here? :-)
Thank you for your time and future suggestions.Everywhere I've lookedApparently you didn't look in the Swing forum, because thats where Swing related questions should be posted.
but how do I assign a cell renderer to an entire row/table ?The easiest way is to use the prepareRenderer(...) method you have already found. My "TablePrepareRenderer" class (which you can find by searching the Swing forum) shows you how to do this.
You will note that the color of the row is determined by data in the table. So all you need to do is add another column in the TableModel that contains the information you need to determine the row color. That column can be removed from view in the table by removing the TableColumn from the TableColumnModel.
Maybe you are looking for
-
How many times can you attempt the restrictions passcode?
I've forgotten the restrictions passcode I set on my iPod. Since I don't want to perform a complete systems reset just yet, I want to try to attempt remembering my passcode... how many times can I try the restrictions passcode without permanently loc
-
HT1386 Cannot sync iphone with windows 7 64 bit
Is it to do with the fact you can't instal the mobile device drivers? Anyone know how to fix this???? Thanks.
-
I have a 15" MBP 4,1 running OS 10.2.2. I started Bootcamp 5.1.3 to install Windows 8. But BC appears only to support Windows 7, so I have not gone past the Select Tasks screen. Is it not possible to install Windows 8 on my MBP?
-
Weird cookies in Safari 5.1 (OS 10.6.8)
Hello, surprisingly, I regularly find that pages like e. g. Facebook, Google, but also many others, put cookies in my system, even though I usually mark the option "block ALL cookies". This happens every time I am using the browser - even when I don'
-
Peformance of setting JVM attribute or callback.
I have a program that receives feeds in the native world and then calls the JVM through JNI with a callback like receivedFeed(attr1, attr2 ....attr20). There are a large number of attributes being passed back for each callback. The question I have ha