バージョン

ItemSelected プロパティ (DataMenuClientEvents)

ItemSelected イベントを処理する JavaScript 関数の名前を取得または設定します。
シンタックス
'宣言
 
Public Property ItemSelected As String
public string ItemSelected {get; set;}

プロパティ値

JavaScript 関数の名前。
使用例
WebDataMenu1.ClientEvents.ItemSelected = "WebDataMenu1_ItemSelected"
WebDataMenu1.ClientEvents.ItemSelected = "WebDataMenu1_ItemSelected";
// The client event 'ItemSelected' takes two parameters sender and e
// sender  is the object which is raising the event
// e is the DataMenuItemCancelEventArgs

function WebDataMenu1_ItemSelected(sender, e) {


    //Gets the DataMenuItem object that is selected
    var Item = e.getItem();

    //Gets the text of the selected item
    var ItemText = Item.get_text();

    //Returns true if the selected item has children else false
    var hasChildren = Item.hasChildren();

    if (hasChildren == false) {
        alert("Item '" + ItemText + "' has no children");
    } else
        alert("Item '" + ItemText + "' has children");


}
参照