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

Grid.hideColumn method while the grid is not shown

5 Answers 186 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Philippe
Top achievements
Rank 1
Philippe asked on 06 Jan 2015, 08:41 AM
Hello,

Here is a short description about how we use KendoUI grid in our project :
- An http request is made from the browser to the server to get a JSON object that contains the grid structure (datatype, name, etc...)
- The grid is dynamically built with the JSON object content
- Some column must be hidden just after the grid construction, so, we use databound event :

dataBound : function() {
 
[...]
 
for (var i = 0; i < as_ColumnsToHide.length; i++) {
                ao_Grid.hideColumn(as_ColumnsToHide[i]);
            }
 
[...]
 
}

When this code is processed, the grid is not visible as it is in a tabstrip component from Telerik ASP.NET Ajax.
An error is raised from hideColumn() method after this "filter" directive :

cell = leafDataCells(container).filter(":visible").eq(headerCellIndex);
cell[0].style.display = "none";

cell[0].style is undefined because the filter method return 0 element.

Could you please see if there is a simple workaround in my situation ?
Regards.

5 Answers, 1 is accepted

Sort by
0
Philippe
Top achievements
Rank 1
answered on 06 Jan 2015, 08:48 AM
Note that this error is raised since we have upgraded to the latest available kendoUI version (v2014.3.1119)
0
Dimo
Telerik team
answered on 06 Jan 2015, 12:44 PM
Hello Philippe,

The described problem was fixed shortly after the 2014.3.1119 release. Please use the latest internal Kendo UI build.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Philippe
Top achievements
Rank 1
answered on 08 Jan 2015, 12:43 PM
Hi,

Thank you for the information, problem is solved with the latest internal build

Regards.
0
Evgeniy
Top achievements
Rank 1
answered on 30 Jun 2016, 04:15 PM

Hi guys,

I use Kendo v.2016.2.504.

I get the same error when I try show/hide column.

I will see error in attachments.

Please advise.

 

0
Dimo
Telerik team
answered on 04 Jul 2016, 01:06 PM
Hi Evgeniy,

The following example uses Kendo UI 2016.2.504 and works as expected. Am I missing something? Please verify that you are using the specified version.

http://dojo.telerik.com/ETipu

Regards,
Dimo
Telerik
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Tags
Grid
Asked by
Philippe
Top achievements
Rank 1
Answers by
Philippe
Top achievements
Rank 1
Dimo
Telerik team
Evgeniy
Top achievements
Rank 1
Share this question
or