@Benjamin
>Thanks

@John

Thanks, I'll certainly have a look into how this could be integrated
with Christian's sorter. It looks an impressive piece of work to me.
The treetable rows would need to be sorted within their parent node's
scope, and I'm sure I've seen this done somewhere, and I think
Christian leaves a hook for it in his plugin.
As for the weird behavior, it's because I'm converting a single table.
The only way of hiding things is to collapse all rows.
I don't think I have the skillset yet to be able to map all the
different permutations of open and closed nodes, in real time, so that
the script would know which rows to expand when a given node was
clicked.
If I used nested tables, or tbodies (which I don't think works in
every browser), then I could get the behavior you're expecting, but it
would slow things down cosiderably, especially on large datasets.
I'm pretty sure this used to be the default way of doing things years
ago (back in the days of Win3.11), so I never even thought about it.
I'll see what the general feedback is, and take it from there.

Thanks again,

Paul.


On Aug 16, 4:06 pm, "John Resig" <[EMAIL PROTECTED]> wrote:
> I've seen requests for this type of plugin frequently - I'd be
> interested in seeing a demo of this combined with the tablesorter
> plugin:http://tablesorter.com/- that would make for a truly
> impressive demonstration.
>
> One quick item: I noticed that when I collapsed a parent item, all
> child items also became collapsed, which seems a little weird.
>
> Great work!
>
> --John
>
> On 8/16/07, PaulHan <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi all,
> > Hope this hasn't come out twice, if it has, apologies.
>
> > I needed a treetable for a project I'm doing, but nothing I had seen
> > quite fitted the bill, so I made my own, and then adapted it so it
> > could be used as a plugin. This is my first plugin, so be kind, any
> > help making it more efficient/jquery-like would be most appreciated.
> > Basically, you build an ordinary html table with the styling you want.
> > You wrap a single tbody around the rows you want to have expanding/
> > collapsing and give it a class or id, as this is the selector that
> > will be used by jQTreeTable. This way, if javascript is disabled,
> > visitors still get the plain table. Then you set up a one dimensional
> > array of parents for each row. The length of this will be the same as
> > are rows in the tbody. For the purposes of mapping the parents, the
> > first row is row 1 (not 0), and corresponds to the first item in the
> > array. The top level items in the tree have a parent of 0, with the
> > rest having their immediate parent's row number as their entry in the
> > array. You'll be able to see all this on the demo page [Link below].
> > You then set the options you would like, like the images for open and
> > closed states, which nodes you want initially collapsed, what column
> > you would like to have the treeview effect. There are already defaults
> > for these options. You feed this hash and array into the jQTreetable
> > plugin and it takes it from there. It can also be set up as just a
> > treeview, by making a one column table, although you are probably
> > better off using Jorn's treeview based on lists if that's all you want
> > to do, as it is probably better performance-wise and definitely better
> > effects-wise. I tried this with a 500 node treetable, which took a
> > couple of seconds to load, probably because of all the randomly
> > generated content, but there didn't seem to be any noticeable degrade
> > in the opening/closing of nodes. If your mileage varies, let me know.
> > It's only been tested in IE7 and Firefox, although I don't expect too
> > many issues as I used very simple CSS swapping for the effect.
> > Feature requests and bug reports are welcome, although feature
> > requests may take some time, as I'd like to wait and see if I can
> > adapt it to some work that some very clever coders over at jQuery UI
> > are doing. The link to it is <a href="http://www.hanpau.com/jquery/
> > unobtrusivetreetable.php">http://www.hanpau.com/jquery/
> > unobtrusivetreetable.php</a>
>
> > Just hope it will be useful to people.
>
> > Regards,
>
> > Paul.

Reply via email to