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

Show/Hide Columns Dynamically

3 Answers 257 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 06 Apr 2015, 04:43 PM

I have been unable to show/hide columns dynamically within a treelist. I have an outside button that I want to swap between hidden and shown columns. I have read the documentation and tried to use:

     var treelist = $("#treeList").data("kendoTreeList");
    treelist.hideColumn(1);  

 However, this does not seem to work. Any help would be appreciated.

3 Answers, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 06 Apr 2015, 04:55 PM

Also, I am already using:

Kendo UI v2015.1.403

0
Paul
Top achievements
Rank 1
answered on 07 Apr 2015, 07:12 PM

The issue stems from when you apply a headerAttribute or attribute style within the columns definition. When this is removed, the show/hide functionality works as expected. 

         var regionHeaderStyle = {
            "class": "name-header-region",
            style: "text-align:right; font-weight:bold;"
        };

        var regionCellStyle = {
            "class": "name-region",
            style: "width:font-size:10px"
        }


        var centerStyle = {
            "class": "name-header-center",
            style: "text-align:center; font-weight:bold;"
        };

        var cellStyle = {
            "class": "name-cell",
            style: "text-align: right; font-size:11px;"
        }

 $("#treelist").kendoTreeList({
            dataSource: dataSource,
            selectable: true,     
            columns: [{
                field: "GeogDesc",
                title: "Region",
                headerAttributes: regionHeaderStyle,
                attributes: regionCellStyle
            }, {
                field: "DispPYTD",
                title: "Disp PYTD",
                headerAttributes: centerStyle,
                attributes: cellStyle
            }]
        });



0
Kiril Nikolov
Telerik team
answered on 08 Apr 2015, 07:24 AM

Hello Paul,

 

It looks like an issue that we need to investigate further. I have logged it in our internal bug tracker and as soon as more information is available I will make sure to get back to you.

 

Thanks for the understanding.

 

Regards,
Kiril Nikolov
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
Paul
Top achievements
Rank 1
Answers by
Paul
Top achievements
Rank 1
Kiril Nikolov
Telerik team
Share this question
or