0

I have a kendo treeview i use this function to bind event change

   change: function (e) {
        if (e.field == "checked") {
            gatherStates(e.items);
            alert(e.items);
        }
    }

If i want to know the 'dad node'(the node that contain the selected child) of the selected child?

Ciccio
  • 468
  • 4
  • 17

2 Answers2

0

You can get the parent node from e.node:

tree.dataSource.bind("change", function (e) {
    if (e.field == "checked") {
        var node = e.items[0];
        console.log("node", node.text);
        console.log("parent", e.node.text);
    }
});

Example here (http://jsfiddle.net/OnaBai/ECnef/)

OnaBai
  • 40,767
  • 6
  • 96
  • 125
  • Yes thank you i have seen the function .parentNode() e.item.parentNode() – Ciccio Feb 01 '13 at 10:54
  • if i want to bind the same evento in kendo grid? so in kendo grid i want to bind in change the checked event.. i have a checkbox column. – Ciccio Feb 04 '13 at 10:55
  • Sorry, I do not understand your question. Would you mind rephrasing it? – OnaBai Feb 04 '13 at 21:05
  • in the treeview i bind the checked event with the code upside "if(e.field == "checked")" with the kendo grid for binding the checked event in the 'change event' there is a same method of that i use in the treeview? { i want to bind a checked event in kendo grid } – Ciccio Feb 05 '13 at 08:14
0

i have a same kind of issue with kendo treeview checkboxes in IE8

jQuery("#treeview").kendoTreeView({
    dataSource: ss,
    dataTextField: ["ss_"],
    checkboxes: {
        checkChildren: true
    },
    select: function (e) {
        jQuery(e.node).find("input")[0].click();
    }
});

var treeview = jQuery("#treeview").data("kendoTreeView");
treeview.expand(".k-item");
treeview.dataSource.bind("change", onCheckboxClicked);

selecting the text of checkbox fires the select event of treeview and in this event i click the checkbox manually (my requirements)...which in turn fires change event of data source in IE-9. But it doesn't fire the change event of datasource in IE-8. What is the issue?

Thanks

Ibrahim
  • 267
  • 1
  • 6
  • 18