【问题标题】:How to get the dataValueField when I select one node选择一个节点时如何获取dataValueField
【发布时间】:2019-02-03 04:07:59
【问题描述】:

我正在使用 kendoTreeView。我想在选择一个节点时获取unitId。

这是我的代码。

  $("#treeview").kendoTreeView({
        dataSource: dataSource,
        dataTextField: "name",
        dataValueField: 'unitId'
   });

数据源示例:

{
    "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
}

【问题讨论】:

    标签: javascript jquery kendo-ui kendo-treeview


    【解决方案1】:

    您使用哪种树视图方法来捕获点击事件?您可以编写 kendoTreeView 提供的选择事件,该事件将为您提供单击/选择的节点的数据。你可以参考这个:https://docs.telerik.com/kendo-ui/api/javascript/ui/treeview/events/select

    如果这对您不起作用,您能否分享您的 DOJO 或 jsFiddle,我可以进一步提供帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-15
      • 2011-10-24
      • 2016-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多