Question

$(document).ready(function()
{
    $('#btnDelete').on('click', function()
    {
        var treeView = $('#treeview').data("kendoTreeView");
        $('#treeview').find('input:checkbox:checked').each(function()
        {
            //I want to capture the value of the ID node here:
            var id = treeView.ID;
            alert(id);
        });
    });
});

I want to select the highlighted item below for each checkbox that is checked:

The alert message is bringing back "undefined".

Was it helpful?

Solution

I figured out how to do it:

$('#treeview').find('input:checkbox:checked').each(function()
    {
        debugger;
        var li = $(this).closest(".k-item")[0];
        var notificationId = treeView.dataSource.getByUid(li.getAttribute('data-uid')).ID;

....
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top