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

Expand when click in the box

3 Answers 117 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 07 Mar 2016, 12:03 PM

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
                };

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 08 Mar 2016, 10:13 AM

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!
 
0
Carlos
Top achievements
Rank 1
answered on 10 Mar 2016, 01:38 PM

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);

0
Nikolay Rusev
Telerik team
answered on 14 Mar 2016, 07:30 AM

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!
 
Tags
TreeList
Asked by
Carlos
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Carlos
Top achievements
Rank 1
Share this question
or