This is a migrated thread and some comments may be shown as answers.

Tree View + Events

3 Answers 81 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 05 Sep 2016, 05:29 AM

Hi,

Just a quick question. Do you have a PHP demo of a tree view in a splitter, where the on click event changes what is in the center-pane (i.e. goes from a Grid View to loading a Map?

Not sure how this wold work considering the PHP has already run?

 

Best Regards

Tom.

3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 06 Sep 2016, 11:11 AM
Hello Tom,

We do not currently have such a demo available. The said scenario can be implemented by calling the splitter ajaxRequest method in the TreeView select event. The ajaxRequest method will replace the pane content with the newly fetched content from the server.

Regards,
Alex Gyoshev
Telerik by Progress
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Faten
Telerik team
answered on 09 Sep 2016, 02:58 AM
Hi Alex,

It seems that Tom is having issues replying to this ticket:

I am trying to get a lazy loaded KendoUI treeview working in PHP, but having problems getting the images for the nodes to work, I have the following defined:

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

    $read = new \Kendo\Data\DataSourceTransportRead();
    $read->url(''/treedata.php'');
    $read->contentType(''application/json'');

    $transport = new \Kendo\Data\DataSourceTransport();
    $transport->read($read);

    $model = new \Kendo\Data\HierarchicalDataSourceSchemaModel();
    $model->id("structid");
    $model->hasChildren("haschildren");

    $schema = new \Kendo\Data\HierarchicalDataSourceSchema();
    $schema->model($model);

    $dataSource = new \Kendo\Data\HierarchicalDataSource();
    $dataSource->transport($transport);
    $dataSource->schema($schema);

    $treeview->dataSource($dataSource);
    $treeview->dataTextField("text");
//    $treeView->dataSpriteCssClassField(''sprite'');        // this blows up php
//    $treeView->dataImageUrlField(''imageurl'');            // this also blows up php

    $treeview->select(''treeview_select'');
    echo $treeview->render();

and the JSON data is defined as:
    $row["text"] = $sObjName;
    $row["guid"] = $sObjGUID;
    $row["type"] = $sObjType;
    $row["structid"] = $sObjStructure;
    $row["haschildren"] = ($row["structid"] != '''');
    $row["sprite"] = strtolower($sObjResType);
    $row["imageurl"] = "images/" . strtolower($sObjResType) . ".png";
    $rows[] = $row;
       :
    echo json_encode($rows);


Everything works except for the images, I have tried to assign images is two different ways (as both a sprite of a bigger image and as individual files) but each causes an error and the entire PHP file fails. 

 

Can you provide any guidance that fix this problem?

thanks




Regards,
Faten
Telerik by Progress
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Alex Gyoshev
Telerik team
answered on 09 Sep 2016, 03:04 PM
Hello Tom,

Can you please provide the PHP error that is thrown by the methods? They are available in the library source code, in the lib/UI/TreeView.php folder.

Regards,
Alex Gyoshev
Telerik by Progress
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TreeView
Asked by
Tom
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Faten
Telerik team
Share this question
or