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
How do I use template or any other technique to send extra info to the treeview
Retrieve that (non-displayed) info on "onSelect" js event