问题
I have a treeview defined like
$("#treeview").kendoTreeView({
dataSource:homogenous,
dataBound: function(e){
$("#treeview").data("kendoTreeView").select(".k-item:first");
},
select: function(){
alert('selectd');
}
});
Initially the treeview is selecting. But it is not getting the alert of select
. But when we selecting the node it is getting the alert. How should i get rid of them.
回答1:
The select method won't fire the select event. You can however use the trigger method to fire any event:
dataBound: function(e){
$("#treeview").data("kendoTreeView").select(".k-item:first");
$("#treeview").data("kendoTreeView").trigger("select", {
node: $("#treeview .k-item:first")[0]
});
},
来源:https://stackoverflow.com/questions/16932642/treeview-select-event-is-not-firing-in-kendo-ui