[Yhc] Re: tbody creation missing from javascript creation functions?

Dimitry Golubovsky golubovsky at gmail.com
Tue Dec 4 21:35:49 EST 2007


Thomas,

On Dec 4, 2007 8:40 PM, Thomas Hartman <tphyahoo at gmail.com> wrote:

>
> Is there some logic to what gets both a set and a get, and what gets just a get?

If IDL says an attribute is readonly then only get. If not, then set and get.

>
> Also, is there an easy way for me to manipulate the attributes, for
> example "height" for a particular tag/dom element?

If this is a DOM attribute, use set'height. If this is a style
attribute, see below.


> How about functionality for setting an element's position /
> dimensions, analogous to setElementPosition / setElementDimensions in
> mochikit (which I'm using now).

Mochikit probably has some wrappers around CSS to work cross browser.

If you would like to manipulate styles directly, use "inlineStyle"
function first (see CDOM/Level2/DomUtils.hs), then use setters and
getters on the TCSS2Properties object.

         inlineStyle inp
           (set'borderWidth "0px") $ \_ ->

Nice thing about setters, you may chain them together:

         inlineStyle inp
           (set'borderWidth "0px") (set'fontSize "14pt") $ \_ ->

But then you need to remember how different browsers name same
attributes (note that EchoCPS2 is not colored correctly in MSIE, while
in FF it is green on black - correct coloring).

>
> http://www.mochikit.com/doc/html/MochiKit/DOM.html

I wish Mochikit had any IDL specs for their interfaces (or perhaps
some XML which with medium amount of pain might be converted to IDL).
Is there any?

Thank you.

-- 
Dimitry Golubovsky

Anywhere on the Web


More information about the Yhc mailing list