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:
00843243
Views:
18
I'm doing nearly the same thing that you suggested, only with a slightly different approach. I iterate from insertion point outwards to the TD element. For any element that I come across that contains "style" information of interest to me (bold, big, italic, a font tag, etc), I save that info and also mark that style info as "already picked up" so that the innermost attributes take precedence. If not of interest, then I ignore the element/attribute. Everything of interest along the way, parentelementing out to the TD element, becomes the picked-up "style" that defines the look of wherever the user had put the cursor. Same basic approach when applying a "style" to a target cell, only I start at the TD level and move inwards. Strip away all existing "style" elements in which I'm interested that encompass the entire cell's contents (which is easy to assess by comparing TD.innertext with the element's innertext), then with CreateElement/ApplyElement slip the remaining cell contents inside of any "style" elements required to convey the picked-up style.

>If your code is working and you're happy, fine.
>
>However you don't *have* to do it that way and FWIW I think that your solution makes a couple of assumptions that might prove to be inappropriate later <s>.
>
>In trying to show you an alternative (possibly as many as 6 steps in a method, but not recursive) I was trying to show you what I believe is a more appropriate solution.
>
>I was also trying to show you why a "one shot method" built into the model didn't really make sense <s>.
>
>Would you want to apply *all* style attributes that were inherited *equally* over *all* content for the cell? For example, if the cell content includes an A tag (this didn't come out properly in my last message, and in case it doesn't again I mean an anchor/hyperlink tag) do you want to apply colors universally? If the cell contains a nested table, what do you want to happen then?
>
>>L<
Previous
Reply
Map
View

Click here to load this message in the networking platform