pcirella / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

Ajax tree does not update last node css if node has no children #118

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a tree from an ajax source.
2. Expand a node, if that node has no children the node shows incorrect
img, should be the img that says the node has no children and expanded.

(If possible, please attach an example HTML file, that works when copied
into the dynatree/doc/ folder.)

What is the expected output? What do you see instead?

What version of the product are you using?
On what operating system and browser?
Ubuntu, FF 3.5

Please provide any additional information below.

Have fixed by adding code to
appendAjax: function(ajaxOptions) {}

if (data.length==0) {                   
   self.aChilds=null;
   self.data.isLazy=false;
   self.render(true,false);
}

Have added this code after self.setLazyNodeStatus(DTNodeStatus_Ok);

Original issue reported on code.google.com by chrisyou...@googlemail.com on 3 Sep 2009 at 1:06

GoogleCodeExporter commented 9 years ago
$Version: 0.5.1$
$Revision: 279, 2009-08-16 21:08:44$

Original comment by chrisyou...@googlemail.com on 3 Sep 2009 at 1:07

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 9 Sep 2009 at 1:59

GoogleCodeExporter commented 9 years ago
This was introduced recently.
I removed an extra attribute ('node was loaded'), because it felt somewhat 
redundant.
Now isLazy + 'childlst==null' is interpreted as 'not yet loaded'.

The idea was, that a server should not set the 'isLazy' flag for empty parent 
nodes
anyway.
This would provide better usabiltity, since the user doesn't have to expand a 
node,
just to find that it is empty.
Objections?

Original comment by moo...@wwwendt.de on 19 Sep 2009 at 7:42

GoogleCodeExporter commented 9 years ago
Well I think it depends on how each tree node is returned by the server. In our 
case,
each node represents a row in a database, and the only way to determine if a 
node has
children is to perform an sql query. This keeps the tree nice and quick by only
reading in necessary nodes, the user has to expand downwards to navigate to 
where
they want to be. The server will perform sql selects along the way to determine 
if
the nodes have children or not.

If each node had to know whether it has children, then we would have to peform 
sql
counts for each child node. And each of those child nodes would need to know 
whether
they have children, performing more database selects etc etc. In effect 
building up
the whole tree.

By the way, I think the dynatree is fantastic, thank you for your continued 
support
of it.

Original comment by chrisyou...@googlemail.com on 21 Sep 2009 at 12:38

GoogleCodeExporter commented 9 years ago
From a point of usability I personally would prefer to let the backend do some
additional work instead of leaving it up to the user ;-)
But of course you're right: there may be scenarios were this is too expensive.

I will look into it. Maybe an empty list [] can be treated as read, while
children=null means unread.

Original comment by moo...@wwwendt.de on 22 Sep 2009 at 9:10

GoogleCodeExporter commented 9 years ago
Issue 125 has been merged into this issue.

Original comment by moo...@wwwendt.de on 12 Dec 2009 at 2:25

GoogleCodeExporter commented 9 years ago
Defered to next update, so drag'n'drop sample is not blocked.

Original comment by moo...@wwwendt.de on 20 Dec 2009 at 10:16

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 15 Mar 2010 at 3:07

GoogleCodeExporter commented 9 years ago
deferred to 0.5.5

Original comment by moo...@wwwendt.de on 30 May 2010 at 7:01

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 8 Nov 2010 at 7:19

GoogleCodeExporter commented 9 years ago
considered verified

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:12