3.2.0

Using a DOM element object as cell content

Hi,

I use a (self-written) library that handles business forms (validation and the like). Internally it uses DOM element objects. Currently, these objects are passed to a self-written grid component which shows them on screen.

Because maintaining my own grid component is a real pain, I'm thinking of switching to ActiveWidgets (either 1.0 or 2.0) for the grid. The problem is, this:

grid.setCellText(function(i, j){return document.createTextNode('test');});

Does (upon rendering) not append the text node to the cell, but assigns it to the cell's innerHTML property instead. This causes its toString method to be called, which returns "[object Text]".

Am I doing something wrong? If not, how much work would it be to make this possible? Would it be more work in version 1.0 than in version 2.0? (I wouldn't mind doing these changes myself if necessary.)

Thanks in advance,

Tim
Tim Cooijmans
May 18,
ActiveWidgets does not use DOM API. Instead, it makes all manipulations with html strings and let the browser parse the html at the very last moment. This happens, for example, when you call document.write(obj) method. This approach was chosen due to the performance reasons, as string operations are, in most cases, much faster than DOM API.

I don't see any easy way how you can combine the code, which produces DOM nodes, with the current grid object (again, mostly for persformance reasons). Basically, you have to serialise your nodes into the html strings and pass it to setCellText() method.
Alex (ActiveWidgets)
May 21,

This topic is archived.

See also:


Back to support forum