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

Hide column when initialize from HTML table?

1 Answer 327 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 27 Jul 2015, 07:34 PM

Initializing from HTML table, how can I specify a column to be hidden? I need to access the data for that column in JS, but don't want to have that data visible to the end user.

http://demos.telerik.com/kendo-ui/grid/from-table

I've tried to use the attribute: data-hidden="true" on the th tag (data-field is also on th tag, as it is in the demo), but it's not working.

Thanks,

--Ed

1 Answer, 1 is accepted

Sort by
0
Accepted
Venelin
Telerik team
answered on 29 Jul 2015, 08:00 AM
Hi Ed,

You can't hide the column using data-hidden="true" attribute as mentioned here: http://docs.telerik.com/kendo-ui/web/grid/introduction#create-a-grid-from-an-existing-html-table

Instead you can do the following:

$(document).ready(function() {
    $("#grid").kendoGrid({
      height: 550,
      sortable: true
    });
     
    $("#grid").data("kendoGrid").hideColumn("make"); //where make is the value of the corresponding data-field attribute
});

Regards,
Venelin
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Ed
Top achievements
Rank 1
Answers by
Venelin
Telerik team
Share this question
or