onCheck event dhtmlxtree

Hello Support,



I want to use onCheck Event of dhtmlxTree.

I tried with setOnCheck(fun) function as well as with tree.attachEvent(“onCheck”,fun);

Both are not working.

I am getting setOnCheck/attachEvent is not a function.

How can I use that event?

Thanks.

If you are using dhtmlxtree 1.5+ the attachEvent must be available. For latest code both next lines are correct
    tree.attachEvent(“onCheck”,custom_function)
or
    tree.setOnCheckHandler(“onCheck”,custom_function)

Please be sure that “tree” variable point to dhtmlxTree object.

Rather in my case it worked like this:

tree.setOnCheckHandler(“onCheck”);

function onCheck(id,state)
{

}