0

jqtree プラグインを使用してツリービューを生成しています。ここで、ラベルを使用してすべてのノードのツリーを並べ替えたいと思います。

プラグインにはソート機能がないため、データをロードする前にソートする必要があると思います。

これはソートする私のデータです。

[
{
    "label": "A label",
    "id": "201",
    "children": [
        {
            "label": "C Label",
            "id": "40773",
            "children": [
                {
                    "label": "F label",
                    "id": "222460",
                    "children": []
                },
                {
                    "label": "C label",
                    "id": "222469",
                    "children": []
                },
                {
                    "label": "X label",
                    "id": "27512",
                    "children": [
                        {
                            "label": "F label",
                            "id": "143546",
                            "children": []
                        },

                        {
                            "label": "D label",
                            "id": "141341",
                            "children": [
                                {
                                    "label": "G label",
                                    "id": "222456",
                                    "children": []
                                },
                                {
                                    "label": "L label",
                                    "id": "222457",
                                    "children": []
                                },
                                {
                                    "label": "x label",
                                    "id": "222443",
                                    "children": [
                                        {
                                            "label": "Z label",
                                            "id": "222447",
                                            "children": []
                                        },
                                        {
                                            "label": "A label",
                                            "id": "222446",
                                            "children": []
                                        }
                                    ]
                                },
                                {
                                    "label": "L label",
                                    "id": "222455",
                                    "children": []
                                }
                            ]
                        },
                        {
                            "label": "A label",
                            "id": "143547",
                            "children": [
                                {
                                    "label": "B label",
                                    "id": "222458",
                                    "children": []
                                }
                            ]
                        },
                        {
                            "label": "R label",
                            "id": "143548",
                            "children": []
                        }
                    ]
                }
            ]
        }
    ]
}

]

ご提案いただきありがとうございます。

4

1 に答える 1