We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

i want to show/hide command column based on session storage in typescript

Thread ID:





142488 Feb 6,2019 09:19 AM UTC Feb 7,2019 11:34 AM UTC Angular 1
Tags: ejGrid
Muthukumar Periasamy
Asked On February 6, 2019 09:19 AM UTC

HI Team ,

I want to hide the command column based on session storage value in EJ1 ejgrid controls with typescript and web api.

Divakaran N

Vignesh Natarajan [Syncfusion]
Replied On February 7, 2019 11:34 AM UTC

Hi Muthukumar, 
Thanks for contacting Syncfusion Support. 
Query: “ want to hide the command column based on session storage value in EJ1 ejgrid” 
We have checked your query and based on your requirement  we have get the value of session variable using window.sessionStorage and based on the variable value we have hide the columns using hideColumns() method of the Grid. You can change the session variable value while performing any actions based on your requirement. 
    var value = window.sessionStorage.getItem('hideColumn'); 
    window.sessionStorage.setItem('hideColumn', true);   
<button class="btn btn-primary" (click)="hideColumn();" type="button">Hide Column</button> 
<ej-grid [allowPaging]="true" [allowSorting]="true" [dataSource]="gridData"> 
        <e-column headerText="Manage Records" width="75" textAlign="right"> 
public gridData: any; 
     hideColumn() : any { 
        var obj = $("#ejControl_0").ejGrid("instance"); 
        obj.hideColumns("Manage Records"); 
    this.gridData = [{ 
        .  .     .  . 
Refer our API documentation for you reference 
If we misunderstood your query, please get back to us with more details. 
Vignesh Natarajan  


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon