Sochettra / dynatree

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

Select node even if it is focused #162

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Select a lazy loaded node. Its contents screen will show and its children in 
the tree will show.
2. Click on something else that will take over the contents area that was 
initially populated by the tree node.
3. Now the tree node will be activated even though its contents are not in 
focus. I can deal with that.
4. Click the active node to see its contents again. The children will collapse 
biut the contents wont be shown as if the node was "selected".

I suppose it would be nice if the selected code would be called ALWAYS 
regardless of if it is active.

Or is it necessary for me to UNACTIVATE the tree on a click outside of the tree?

Using the latest version.

Original issue reported on code.google.com by oll...@gmail.com on 8 Nov 2010 at 2:37

GoogleCodeExporter commented 8 years ago
With 'contents screen' you mean a preview pane in your application?

ad 3. 
We are in fact calling deactivate() for the active node, when the context 
changes.
That reflects the context status best, I think

ad 4.
in that case clicking the node again would work as expected.
Alternatively you could use onClick(node) instead of onActivate(node), this is 
fired always.

Original comment by moo...@wwwendt.de on 8 Nov 2010 at 4:07

GoogleCodeExporter commented 8 years ago
Duh. onClick is exactly what I was thinking of.

I found that I need to leave the onActivate option, even though there is 
nothing in the function, otherwise the node would not be activated. So it 
currently looks like...

onActivate: function(n) {

        },
        onClick: function(n) {
            loadPluginView(n.data.plugin_id, n.data.plugin_type, n.data.plugin_type+'_edit_view', false);
        },

So with the onClick I am getting my "preview pane"/"contents screen" as I was 
hoping. The only problem now is I would like to check if the node is already 
open, if so, do not collapse the children. Only the plus/minus sign would be 
doing the collapse in this situation.

Original comment by oll...@gmail.com on 8 Nov 2010 at 4:19

GoogleCodeExporter commented 8 years ago
> I found that I need to leave the onActivate option...

I would consider this a bug but i could not reproduce it.
Could you confirm this one?

Original comment by moo...@wwwendt.de on 9 Nov 2010 at 7:09

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 9 Nov 2010 at 7:09

GoogleCodeExporter commented 8 years ago
could not reproduce

Original comment by moo...@wwwendt.de on 14 Nov 2010 at 2:36