首页 > 解决方案 > 使用 JSON(不是以编程方式)更改 jstree 节点的“文本颜色”

问题描述

我有一个简单的 jstree 实例:

$('#user_file_listing').jstree(
    {
        'core' : {
            'check_callback': true,
            'data' : [
                { "id" : "#schemas", "parent" : "#", "text" : "Generated Files" },
                { "id" : "#yangfiles", "parent" : "#", "text" : "YANG" },
                { "id" : "#yamlfiles", "parent" : "#", "text" : "YAML" }
            ],
            "themes":{
                "icons": true,
                "dots" : true
            }
        }
    }
);

如何使用 JSON“数据”本身指定特定节点的文本颜色?

所有以前的 SO 问题都提供了“以编程方式”而不使用 JSON 数据的解决方案。

标签: javascriptjstree

解决方案


推荐阅读