我正在创建一个双语表单,其中使用了 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"]
});
关于javascript - 如何使用 jquery 更改 jstree 方向?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41822313/