Tree View + Events

4 posts, 0 answers
  1. Tom
    Tom avatar
    1 posts
    Member since:
    Sep 2016

    Posted 05 Sep Link to this post

    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.

  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 06 Sep Link to this post

    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!
     
  3. UI for ASP.NET AJAX banner
  4. Faten
    Admin
    Faten avatar
    7 posts

    Posted 08 Sep Link to this post

    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!
     
  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 09 Sep Link to this post

    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!
     
Back to Top
UI for ASP.NET AJAX banner