繁体   English   中英

如何使用jquery更改jstree方向?

[英]How to change jstree orientation using jquery?

我正在创建一个双语表单,其中我使用了jstree。 我将在两种语言之间切换,方向不同。 我知道jstree继承了body的方向。 但我想以编程方式改变它的方向。

这是我的jstree代码:

$('#productTree').jstree({
    "core": {
        'data': result.ProductsTree,
        "multiple": true,
        "check_callback": false,
        'themes': {
            'variant': 'large',
            'stripes': true,
            "icons": true,
        }
    },
    "checkbox": {
        "keep_selected_style": false,
        "three_state": false
    },
    "plugins":
        ["checkbox"]
});

您必须在核心选项对象中启用rtl选项:

$('#productTree').jstree({
    "core": {
        'rtl' : true,
        'data': result.ProductsTree,
        "multiple": true,
        "check_callback": false,
        'themes': {
            'variant': 'large',
            'stripes': true,
            "icons": true,
        }
    },
    "checkbox": {
        "keep_selected_style": false,
        "three_state": false
    },
    "plugins":
        ["checkbox"]
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM