如何获取KendoUI树视图中特定节点的节点值?

时间:2013-08-05 18:23:03

标签: javascript jquery kendo-treeview

我需要获取notificationId的节点VALUE。

节点的名称是XML中的“ID”。

这就是我现在所拥有的:

$(function DeleteNotification (userId)
{
    $('#btnDelete').on('click', function()
    {
        debugger;
        var treeView = $('#treeview').data("kendoTreeView");

        $('#treeview').find('input:checkbox:checked').each(function()
        {
            //this is what im trying to get but once i get to this point, nothing happens under debug mode
            var notificationId = treeView.text($("#ID"));

            alert(notificationId);

            //treeView.remove($(this).closest('.k-item'));
        });
    });
});

此行不起作用:

var notificationId = treeView.text($("#ID"));

如果将鼠标悬停在变量“treeView”上,您会看到:

我需要带圆圈的值。

有谁知道怎么做?过去3天我一直在和我争斗,我找不到我需要的信息......

1 个答案:

答案 0 :(得分:1)

treeView.dataSource._data[2].notifications[0].ID
相关问题