Mangalaputta / dynatree

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

An empty string "" should be an acceptable key name #445

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What new or enhanced feature are you proposing?
Currently, setting a key name to "" results in a serial key being assigned by 
dynatree, as if the key were null.  I would like to see "" treated as a valid 
string, therefore a valid key.

What goal would this enhancement help you achieve?
I was trying to use fully-qualified path names as my keys.  For convenience of 
string joining with a separator (e.g. "/"), I wanted to use an empty string "" 
for the key of my root.  So, if the root's child node was named "child1", its 
key would be: "" + /" + "child1", therefore "/child1".

Original issue reported on code.google.com by augursys...@gmail.com on 23 Jul 2013 at 2:23

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 23 Jul 2013 at 3:02

GoogleCodeExporter commented 8 years ago
I thought that this should also be fixed with issue 420
Did you try witj the lates code from the trunk?

This is the patch for 420:

    // if( !data.key ){
    if( data.key == null ){ // test for null OR undefined (issue 420)
        data.key = "_" + tree._nodeCount++;
    }else{
        data.key = "" + data.key;
    }

Original comment by moo...@wwwendt.de on 27 Jul 2013 at 6:41

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 8 Sep 2013 at 6:33