ツリービューがあり、さまざまなアイテムの右クリック サポートを追加したいと考えていました。これが私がやった方法です:
http://jsfiddle.net/doonot/xWjSz/
メニューは最初のルート モジュール (右クリック後) に対してのみ表示され、残りのルート モジュールに対しては表示されません。すべてのルート モジュールのメニューを表示するには、何を変更する必要があるか教えてもらえますか?
どうもありがとう、私はあなたの答えに感謝します。
ツリービューがあり、さまざまなアイテムの右クリック サポートを追加したいと考えていました。これが私がやった方法です:
http://jsfiddle.net/doonot/xWjSz/
メニューは最初のルート モジュール (右クリック後) に対してのみ表示され、残りのルート モジュールに対しては表示されません。すべてのルート モジュールのメニューを表示するには、何を変更する必要があるか教えてもらえますか?
どうもありがとう、私はあなたの答えに感謝します。
Hiyaこのデモ http://jsfiddle.net/hYJPv/1/ または http://jsfiddle.net/hYJPv/ (問題を修正)を参照するか、ここで差分アプローチを参照してくださいhttp://jsfiddle.net/UeqBk/for_Dooonot_from_Tats_innit/
rightclick
あなたにアラートが表示されます。
コード
$(document).ready(function()
{
// If you want to disable showing the context menu when right clicking
// on the document, the code below would do the trick.
$(document).bind("contextmenu",function(e)
{
alert('right click capture');
return false;
});
var $tree = $("#tree").kendoTreeView(
{
select: function (event)
{
var $item = $(event.node);
console.log( $item );
alert( "selected" );
}
});
// Find the item you want to select...
var $selected = $('#selected');
var $treePath = $selected.parentsUntil($tree, "li");
var treeView = $tree.data('kendoTreeView');
// Expand the tree in order to show the selected item
treeView.expand( $treePath );
// Gotta make both calls...
treeView.select( $selected );
treeView.trigger( 'select', {node: $selected} );
});