2013-08-05 137 views
0

我需要获取notificationId的节点VALUE。如何获取KendoUI treeView中特定节点的节点值?

节点的名称是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")); 

如果你将鼠标悬停在变量 “树视图”,你会看到:

我需要圆圈值。

有谁知道如何做到这一点?我在过去3天一直在与此作斗争,而且我找不到我需要的信息...

回答

1
treeView.dataSource._data[2].notifications[0].ID 
+0

感谢此工作。你是人!我需要等待10分钟才能接受你的答案...... grrr ... –

+0

Neal,我将如何基于我在OP中的循环实现这个?我想在所有选中的节点上运行“alert”功能。 –

相关问题