BALKANGraph / FamilyTreeJS

Build family tree app with BALKAN FamilyTreeJS library. Family Tree also called a genealogy or a pedigree chart, is a chart representing family relationships in a conventional tree structure.
50 stars 16 forks source link

`onUpdateNode` has `gender` as an array instead of a string #104

Closed pandabytes closed 2 months ago

pandabytes commented 2 months ago

Description

Version: 1.9.17

I notice that if I specify gender as a select dropdown field in the options, the gender field becomes an array instead of a string value when using onUpdateNode.

What I expect

gender: "male"

What I get

gender: [ "male" ]

Example

var family = new FamilyTree(document.getElementById("tree"), {
    mouseScrool: FamilyTree.action.none,
    nodeBinding: {
        field_0: "name"
    },
    nodeTreeMenu: true,
    editForm: {
        elements: [
            {
                type: 'textbox',
                label: 'Name',
                binding: 'name',
            },
            {
                // Make gender field a dropdown
                type: 'select',
                label: 'Gender',
                binding: 'gender',
                options: [
                    {
                        value: 'male',
                        text: 'Male'
                    },
                    {
                        value: 'female',
                        text: 'Female'
                    }
                ]
            },
        ]
    }
});

family.onUpdateNode(args => {
    console.log(args);
});
image
ZornitsaPesheva commented 2 months ago

Hi, we have fixed the issue. Please get the latest version - 1.09.18

pandabytes commented 2 months ago

Thank you!