Re: Modifying DOM before netWindows tree widget created.
Michael Flanagan <[email protected]> Wed, 21 Apr 2004 22:52:47 -0700
| Newsgroups | gmane.comp.windows.devel.netwindows |
|---|---|
| Message-ID | <[email protected]> |
Hi Bernard, My response follows inline... On 21-Apr-04, at 7:21 PM, [email protected] wrote: > Let me explain what I am doing. I have a discussion hierarchy that > Domino cannot return in the structured manner required by netWindows > (ie the nested div elements representing the hierarchy). But Domino > will return an identifier for each entry, and the structure of this > identifier corresponds to the depth and location of the entry in the > hierarchy. > > I am manipulating the DOM in Javascript using this identifier before I > want to pass it on to netWindows tree widget to process. The > manipulated DOM structure is fine if I save it to a file with the > relevant netWindows code in the html head - when I load the file, it > is processed appropriately by the tree widget (and very cool it is > too...) So, my understanding here is that you have a data structure that is being sent from Domino to netWindows (henceforth nw), but you are unable to translate the Domino output into the DOM structure that nw natively understands and can parse. What you're doing is using JavaScript to take that Domino output and use it as a map to build the DOM structure that nw is expecting for input in the tree widget. This seems like a lot of work to do, especially if your discussion hierarchy is really large. My first thought is that you should really try and find a way to massage the Domino data outside of the browser as while you can do Cool Stuff (tm) with JavaScript, there is such a thing as abuse... but I digress. > However, I am at a loss as to the best way to coordinate this > processing. Alex (briefly) suggested that __data__.getData() would be > the way to do it. But looking through The Manual, it looks a) like > this is for asynchronous data retrieval to update the page already > displayed b) even if it would be appropriate for the initial loading > of my data prior to manipulation, I don't really understand how the > data structure part of the the call would work. [It did strike me > when I read how __data__.getData() works, that maybe that is where I > should be manipulating the structure of my document - but as I spent > so long getting it to work my way, I'm reluctant to change it ;-) ] I would tend to agree with your idea of just sticking w/ what you have until your solution works. Then see if where you can improve on it. > I also noticed that there are the __sig__.connectByName calls, and > wondered if they might not be more appropriate. When you are done manipulating your div structure why not just call the inline factory function and create your tree once you have your div structure in hand? Then you don't have to worry about making things happen at the right time. If you didn't want to do this, you could just call tree.setChildrenFromProps() on the existing tree after you've assembeled your div's. Either way should work the same. > All I really want to do is > - load my page > - manipulate div structuring in the DOM > - have netWindows tree widget then process this altered page > > Regards, > Bernard Not sure if this feedback helps. I'm new to the tree widget myself, I just blew through the src for the first time now to see what it was doing. This is a new widget too so it's possible that you're encountering something that hasn't been experienced by anyone else b/c no one else has tried to do what you're doing. Cheers, Michael _______________________________________________ The netWindows developers list: [email protected] http://netwindows.org/mailman/listinfo/devel_netwindows.org