Expand when click in the box

4 posts, 0 answers
  1. Carlos
    Carlos avatar
    11 posts
    Member since:
    Sep 2015

    Posted 07 Mar Link to this post

    I have a tree list with 2 parents nodes, I wonder if there's any way when I click within the parent box happen the same effect that happens when I click the arrow to open the children items

    Here is the config of my tree list

    $scope.treelistOptions = {
                        dataSource: {
                            data: $scope.treeData,
                            schema: {
                                model: {
                                    fields: {
                                        id: { type: "integer", editable: false, nullable: false },
                                        parentId: { field: "parentId", nullable: true, type: "integer" }
                                    },
                                    expanded: true
                                }
                            }
                        },
                        columns: [
                            { field: "operationCode", title: "Descrição", attributes: {"class": "colorFirstColumn"},
                                template: "<strong>#: operationCode #</strong>"},
     
                            { field: "qtdTotalCompra", title: "MWm"},
     
                            { field: "valorTotalCompra", title: "R$"},
     
                            { field: "qtdTotalVenda", title: "MWm"},
     
                            { field: "valorTotalVenda", title: "R$"},
     
                            { field: "valorTotalBalanco", title: "Balanço"},
                            { field: "valorResultado", title: "Resultado"}
                        ],
                        sortable: false,
                        reorderable: false,
                        resizable: true,
                        columnMenu: false
                    };

  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 08 Mar Link to this post

    Hello Carlos,

     

    You can attach click handler for the rows and inside that handler call the expand method.

     

    Regards,
    Nikolay Rusev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Carlos
    Carlos avatar
    11 posts
    Member since:
    Sep 2015

    Posted 10 Mar Link to this post

    Thanks for your answer Nikolay, i follow yout tip but without success, when i try to get $("#treelistOptionsDetail").data("kendoTreeList"); it's return undefined and i can't proceed.

    <kendo-treelist k-data-source="treeDataDetail" options="treelistOptionsDetail"></kendo-treelist>
     
    var data = $scope.treelistOptionsDetail.dataSource.data.at($scope.treeDataDetail.length -2);
     
     
    var treeList = jQuery("#treelistOptionsDetail").data("kendoTreeList");                  console.log(treeList);
    var row = treeList.content.find("tr[data-uid=" + data.uid + "]");
    $scope.treelistOptionsDetail.expand(row);

  5. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 14 Mar Link to this post

    Hello Carlos,

     

    I've created quick example for the case. You can find it attached bellow: http://dojo.telerik.com/@rusev/EtElA

     

    Regards,
    Nikolay Rusev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready