我正在使用kendoTreeView。我想要在选择一个节点时获取unitId。
这是我的代码。
$("#treeview").kendoTreeView({
dataSource: dataSource,
dataTextField: "name",
dataValueField: 'unitId'
});
dataSource示例:
{
"rows": [{
"_token": "8cfd3e2133d936a6a65c6f7cfb80268a",
"objectVersionNumber": null,
"unitId": 10002,
"parentId": 10001,
"unitCode": "100000",
"name": "Hand",
"description": null,
"managerPosition": null,
"companyId": null,
"enabledFlag": null,
"unitCategory": null,
"unitType": null,
"positionName": null,
"parentName": null,
"parentCode": null,
"hasChildren": true
}],
"success": true,
"total": 1
}
发布于 2019-02-03 06:23:48
您使用treeview的哪种方法来捕获单击事件?您可以编写kendoTreeView提供的select事件,该事件将为您提供所单击/选择的节点的数据。你可以参考这个:https://docs.telerik.com/kendo-ui/api/javascript/ui/treeview/events/select
如果这对你不起作用,你能分享你的DOJO或jsFiddle吗?我可以提供进一步的帮助。
https://stackoverflow.com/questions/54499869
复制相似问题