Re: Voodoo programming case one

2008-03-20 Thread s. isaac dealey
  Thanks.  You're right, using class is a standard approach, however,
  the new CFWINDOW tag is nice but quite picky and I have more than one
  cfwindow on the same page, so, inline js tends to work better for my
  case...
 
 Shouldn't matter in this case because you're changing the class of the
 parent table, identified by its ID. So you can have 1 table or you can
 have 50 tables and they'll all work using the same class definitions. 

Or rather they can all work using one css block - you'd have to change
the css so that the first item in the selector isn't the id of the table,
which should be pretty trivial. 

-- 
s. isaac dealey  ^  new epoch
 isn't it time for a change? 
 ph: 503.236.3691

http://onTap.riaforge.org/blog



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301680
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Voodoo programming case one

2008-03-20 Thread s. isaac dealey
 Thanks.  You're right, using class is a standard approach, however,
 the new CFWINDOW tag is nice but quite picky and I have more than one
 cfwindow on the same page, so, inline js tends to work better for my
 case...

Shouldn't matter in this case because you're changing the class of the
parent table, identified by its ID. So you can have 1 table or you can
have 50 tables and they'll all work using the same class definitions. 

-- 
s. isaac dealey  ^  new epoch
 isn't it time for a change? 
 ph: 503.236.3691

http://onTap.riaforge.org/blog



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301678
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Voodoo programming case one

2008-03-19 Thread Don L
Hi,

I got this a table with multiple rows, one column contained lengthy data, so, 
it is assigned td width=40%.  Now, I want to give users the flexibility to 
temporarily close a column or two by a simple click (very trival js to 
implement) but I'd like all the TDs for this BIG column to expand to, say, 
60%,
quick googling did not seem to find a solution; came up with my own of
{BIGtdID}.style.width=80%, it works with IE7, but does the syntax conform to 
standard?

Thanks. 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301610
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Voodoo programming case one

2008-03-19 Thread s. isaac dealey
imo put a class on each of the td cells in that column and a separate
class or id on the table - when they hit the button to expand/collapse
the other column, change the class name(s) of the parent table, i.e. 

style type=text/css
  #mytable td.bigtd { width: 40%; }
  #mytable.more td.bigtd { width: 60%; } 
  #mytable.more td.blah { display: none; } 
/style

script language=javascript
  function bigTDMore() {
document.getElementById('mytable').className = 'more';
  }
/script

a href=javascript:void(0); 
onclick=bigTDMore();more/a

table id=mytable
  tr
td class=col1stuff/td
td class=blahblah/td
td class=bigtdmore blah/td
  /tr
  tr
td class=col1more stuff/td
td class=blahblah/td
td class=bigtdmore blah/td
  /tr
/table

hth,
ike

p.s. I would recommend actually placing the width on a col tag, but
when I've tried it in the past, it's not worked the way it should.


-- 
s. isaac dealey  ^  new epoch
 isn't it time for a change? 
 ph: 503.236.3691

http://onTap.riaforge.org/blog



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301611
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Voodoo programming case one

2008-03-19 Thread Don L
Thanks.  You're right, using class is a standard approach, however, the new 
CFWINDOW tag is nice but quite picky and I have more than one cfwindow on the 
same page, so, inline js tends to work better for my case...

Since we're at it, I was wondering if there are other techniques to achieve the 
same goal, I know Flex can, but its overhead may not be justfiable for this 
case...



Don
imo put a class on each of the td cells in that column and a separate
class or id on the table - when they hit the button to expand/collapse
the other column, change the class name(s) of the parent table, i.e. 

style type=text/css
  #mytable td.bigtd { width: 40%; }
  #mytable.more td.bigtd { width: 60%; } 
  #mytable.more td.blah { display: none; } 
/style

script language=javascript
  function bigTDMore() {
document.getElementById('mytable').className = 'more';
  }
/script

a href=javascript:void(0); 
onclick=bigTDMore();more/a

table id=mytable
  tr
td class=col1stuff/td
td class=blahblah/td
td class=bigtdmore blah/td
  /tr
  tr
td class=col1more stuff/td
td class=blahblah/td
td class=bigtdmore blah/td
  /tr
/table

hth,
ike

p.s. I would recommend actually placing the width on a col tag, but
when I've tried it in the past, it's not worked the way it should.


-- 
s. isaac dealey  ^  new epoch
 isn't it time for a change? 
 ph: 503.236.3691

http://onTap.riaforge.org/blog 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301613
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Voodoo programming case one

2008-03-19 Thread Jim Davis
 -Original Message-
 From: Don L [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 19, 2008 7:38 PM
 To: CF-Talk
 Subject: Re: Voodoo programming case one
 
 Thanks.  You're right, using class is a standard approach, however, the
 new CFWINDOW tag is nice but quite picky and I have more than one
 cfwindow on the same page, so, inline js tends to work better for my
 case...

Well... you can change just the width property of the column as easily as
you can change the class name using the script Isaac provided (actually, at
worst, you'd need to loop over the cells and set the width... but you should
be able to do that to just a single cell and have it work).

You don't NEED to use classes.  But they do make it simpler to understand.

Also note that while, technically, style declarations should be in the HEAD
all major browsers (and all minor ones that  I know of) accept them inline
as well.  So inline away!

Note that IE 6 has a weird behavior in some cases (specifically where you're
including new content into a container on a page).  If it looks like your
included content is ignoring style declarations try moving the style
information to the bottom of the page.  I describe the issue here:

http://www.depressedpress.com/Content/Development/JavaScript/Articles/Quirk_
IncludeStyles/Index.cfm

Jim Davis


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301617
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Voodoo programming case one

2008-03-19 Thread Don L
 Thanks.  You're right, using class is a standard approach, however, the
 new CFWINDOW tag is nice but quite picky and I have more than one
 cfwindow on the same page, so, inline js tends to work better for my
 case...

Well... you can change just the width property of the column as easily as
you can change the class name using the script Isaac provided (actually, at
worst, you'd need to loop over the cells and set the width... but you should
be able to do that to just a single cell and have it work).

You don't NEED to use classes.  But they do make it simpler to understand.

Also note that while, technically, style declarations should be in the HEAD
all major browsers (and all minor ones that  I know of) accept them inline
as well.  So inline away!

Note that IE 6 has a weird behavior in some cases (specifically where you're
including new content into a container on a page).  If it looks like your
included content is ignoring style declarations try moving the style
information to the bottom of the page.  I describe the issue here:

http://www.depressedpress.com/Content/Development/JavaScript/Articles/Quirk_
IncludeStyles/Index.cfm

Jim Davis

Thanks.  As I indicated in my very first post, it was working (at that point I 
did not test it with IE6 though). Later I tested with IE6, and it seems fine as 
well.  I was curious to know if there's a better approach... It's good to know 
you endorse this approach as well.








~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301619
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Voodoo programming case one

2008-03-19 Thread Jim Davis
 -Original Message-
 From: Don L [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 19, 2008 11:08 PM
 To: CF-Talk
 Subject: Re: Voodoo programming case one
 
 
 Thanks.  As I indicated in my very first post, it was working (at that
 point I did not test it with IE6 though). Later I tested with IE6, and
 it seems fine as well.  I was curious to know if there's a better
 approach... It's good to know you endorse this approach as well.

Well... I guess it's like everything else: there are a thousand ways to do
anything and what makes them better will change depending the need.

For pure speed not much is going to improve upon Isaac's single line of code
and one DOM change.  But it does require some pre-work.  There are other
ways to do the same thing where the table in question needs no prior set up.

One script could accepts a DOM reference to a table and do all the work.  It
could - just by looping over the DOM -  add a link or control to the headers
to collapse the columns, add all of the style information needed, all of the
event information, etc.

This would be more complex, but in the end you'd have a simple-to-use script
that could add this functionality to ANY table with a single line of code
(and NO manual changes to the table).  You could also add in row sorting,
cell selection, etc - any features you want.

This would definitely be better in the sense of being more encapsulated,
more portable and more reusable.

Jim Davis


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301621
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Voodoo programming case one

2008-03-19 Thread Don L
 Thanks.  As I indicated in my very first post, it was working (at that
 point I did not test it with IE6 though). Later I tested with IE6, and
 it seems fine as well.  I was curious to know if there's a better
 approach... It's good to know you endorse this approach as well.

Well... I guess it's like everything else: there are a thousand ways to do
anything and what makes them better will change depending the need.

For pure speed not much is going to improve upon Isaac's single line of code
and one DOM change.  But it does require some pre-work.  There are other
ways to do the same thing where the table in question needs no prior set up.

One script could accepts a DOM reference to a table and do all the work.  It
could - just by looping over the DOM -  add a link or control to the headers
to collapse the columns, add all of the style information needed, all of the
event information, etc.

This would be more complex, but in the end you'd have a simple-to-use script
that could add this functionality to ANY table with a single line of code
(and NO manual changes to the table).  You could also add in row sorting,
cell selection, etc - any features you want.

This would definitely be better in the sense of being more encapsulated,
more portable and more reusable.

Jim Davis
Yes.  Especially on This would be more complex, but in the end you'd have a 
simple-to-use script that could add this functionality to ANY table with a 
single line of code (and NO manual changes to the table).  You could also add 
in row sorting,
cell selection, etc - any features you want. This would definitely be better 
in the sense of being more encapsulated, more portable and more reusable..  It 
makes sense, in the meantime, as you may have implied, I would have to weigh on 
spending time on what's most important... (opportunity cost).  Thanks.






~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301626
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4