douqun1977 2017-08-01 10:48
浏览 169

获取有关Kendo UI Treeview节点选择事件的额外信息

What I want

To populate a div based on the Kendo Treeview node click, based on some extra information which is based from the server-side.

What I am doing

Using PHP to send arrays as data to kendo treeview control, here is the code:

 <?php
        require_once 'telerik/wrappers/php/lib/Kendo/Autoload.php';

        $treeview = new \Kendo\UI\TreeView('treeview');

        $dataSource = new \Kendo\Data\DataSource();
        $dataSource->data($data);

        // The 'treeview_collapse' JavaScript function will handle the  'treeview_collapse' event of the treeview
        $treeview->collapse('treeview_collapse');

        //Configuring treeview's dataTextField and set its dataSource.
        $treeview
                ->dataTextField('value')
                ->dataSource($dataSource)
                ->collapse("onCollapse")
                ->expand("onExpand")
                ->select("onSelect")
                ->navigate("onNavigate");

        //Output the TreeView by echoing the result of the render method.
        echo $treeview->render();
        ?>

$data variable has the following value:

Array
(
    [0] => Array
        (
            [value] => Please select from the following menu
        )

    [1] => Array
        (
            [value] => 1. Manage Call Signature
            [type] => IMMEDIATE
            [closeSession] => false
            [items] => Array
                (
                    [0] => Array
                        (
                            [value] => Please select your service
                        )

                    [1] => Array
                        (
                            [value] => 1. Manage MyStatus
                            [type] => IMMEDIATE
                            [closeSession] => true
                            [items] => Array
                                (
                                    [0] => Array
                                        (
                                            [value] => We are processing your MS request, you will be informed via SMS shortly
                                        )

                                )

                        )

                    [2] => Array
                        (
                            [value] => 2. Manage IntroMe
                            [type] => IMMEDIAte
                            [closeSession] => true
                            [items] => Array
                                (
                                    [0] => Array
                                        (
                                            [value] => We are processing your IM request, you will be informed via SMS shortly
                                        )

                                )

                        )

                )

        )

    [2] => Array
        (
            [value] => 2. Subscribe
            [type] => FORWARD
            [closeSession] => false
            [forwardProtocol] => HTTPGET
        )

)

Through the above data this treeview is rendered

So I want to retrieve [type], [closeSession] and [items] as well whenever a node is clicked.

My Quetion

  1. How do I use template or any other technique to send extra info to the treeview

  2. Retrieve that (non-displayed) info on "onSelect" js event

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 教务系统账号被盗号如何追溯设备
    • ¥20 delta降尺度方法,未来数据怎么降尺度
    • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
    • ¥15 再不同版本的系统上,TCP传输速度不一致
    • ¥15 高德地图点聚合中Marker的位置无法实时更新
    • ¥15 DIFY API Endpoint 问题。
    • ¥20 sub地址DHCP问题
    • ¥15 delta降尺度计算的一些细节,有偿
    • ¥15 Arduino红外遥控代码有问题
    • ¥15 数值计算离散正交多项式