ノードをドロップした後にツリーをリロードしたい。問題は、ツリーで関数を呼び出す方法がわからないことです。
私はツリー、コンテナのID、ファンシーツリーを使ってみました..ファンシーツリーウィジェットをロードするソースは次のとおりです。
echo FancytreeWidget::widget([
'options' =>[
'source' => $chapters,
'extensions' => ['dnd'],
'icons' => false,
'activeVisible' => true,
'dnd' => [
'preventVoidMoves' => true,
'preventRecursiveMoves' => true,
'autoExpandMS' => 400,
'dragStart' => new JsExpression('function(node, data) {
startNode = node;
return true;
}'),
'dragEnter' => new JsExpression('function(node, data) {
return true;
}'),
'dragDrop' => new JsExpression('function(node, data) {
dropNode = node;
data.otherNode.moveTo(node, data.hitMode);
updatePosition();
node.render(force=true);
}'),
],
],
]);