Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DHTML DOM question
Message
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00842018
Message ID:
00842772
Views:
24
-------------
No. Unfortunately cloneNode really doesn't address the problem. What is really needed are two methods that complement each other:
------------

I'm sorry, but I don't see why this is.

I mean, I did read what you wrote about walking up the tree and I know exactly what you're doing there, and why <s>. I just don't think what you think you need is the right way to replace it.

Can you give me a practical example of the code that isn't working? So I can see exactly what you're trying to apply to what?

----------
oTargetCell.ApplyVisualAttributeObject(oSourceFormatting)
----------

This is not what I envision at all <s>. In fact I think it's a really bad/limited solution, for reasons that I will elaborate if you're interested, later if they're not obvious from what I'm saying below...

Anyway: The procedure I envision, which does not need recursion except possibly *downwards*, not upwards, is something like this:

* From what you're planning to save in the target contents's innerHTML and outerHTML, remove any style information that you want to replace or override. This is a question of checking the existing attributes as you know. Look for the ones you want to override, nuke 'em. I don't know which ones they are and they may not be all the style attributes, just take out the ones you want.

* Clone the source cell.

* Assign the innerHTML from the source cell to the clone.

* Remove any style information from the clone's innerHTML that you do *not* want to propagate, or just remove its innerText contents if that's all it's going to take in your case.

See, it's not enough to say "I want to propagate visual elements" -- this could mean a lot of things and the contents of the cell in question might have addition child elements, both visual and non visual, that you'd want to consider for your situation. Such as tags. Here's where recursion *downwards* might apply -- what are you planning to do about nested cells and their possible contents?

But you're probably not concerned with that, since you probably have control over the limited DHTML in your design. Anyway, make your decisions about what to propagate and what not to propagate, as best fits your DHMTL here.

* Now assign the limited or revised innerHTML contents, whatever you want to keep, from the target to the clone.

* Use replaceNode to swap the clone in for the target.

Whatever is supposed to be inherited should come out okay without explicit reference, IMHO.

This is in the case where the content to which you want to apply new visual styles already exists.

Where you're cloning content to *new* rows or columns, of course, it should be a simpler problem, right?

>L<
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform