Home Analyst Portal

Hide columns in views with javascript

Thomas_StrombergThomas_Stromberg Premier Partner Advanced IT Monkey ✭✭✭
Has anyone done any custom javascript to hide what colums that are showed by default? for example hide the SLO column. 

Best Answer

Answers

  • Brett_MoffettBrett_Moffett Cireson PACE Super IT Monkey ✭✭✭✭✭
    You can hide the columns manually and this will "Stick" with the user who disables it.
    Just click on one of the headings in the grid view and select Choose Columns. You will then be able to select, or deselect the columns you wish.



    This view setup is then held for the user within the database and will show up no matter what system they log on to.

    Is this what you were looking for?
  • Thomas_StrombergThomas_Stromberg Premier Partner Advanced IT Monkey ✭✭✭
    This customer does not allow IE cached items to be save in the profile so that approach is not good. We can hide using that way but the next time a user logon they have to hide the views again. 
  • Brett_MoffettBrett_Moffett Cireson PACE Super IT Monkey ✭✭✭✭✭
    It was my understanding that the views were stored in the DB and not in the browser cache.
    Let me confirm this and post the answer here.
  • Thomas_StrombergThomas_Stromberg Premier Partner Advanced IT Monkey ✭✭✭
    The filter options are not save in the DB. The views are but not sure about modifying systems views direct in the DB is a good way. And the changes are lost on a upgrade anyway. 
  • Brett_MoffettBrett_Moffett Cireson PACE Super IT Monkey ✭✭✭✭✭
    I stand corrected.
    Views are stored in the browser cache.

    I'll keep trying to dig up where the default views are stored and how they can be modified. 
  • Thomas_StrombergThomas_Stromberg Premier Partner Advanced IT Monkey ✭✭✭
    Hi @Thomas_Stromberg
    This one looks like its gone a bit cold so I thought I'd have a look for you.
    Its not a super elegant solution but you can collapse a column to 0px width with some CSS.

    #c322e552-d725-4822-8ca6-7235b4ae073c > table > colgroup > col:nth-child(8) {
    width: 0px !important;
    }
    You'll need to change the GUID to the GUID of the grid in question and the column number nth-child(x)

    This example hides created date on My Requests.

    See if that can work for you?

    Geoff
    I tried that but i must done something wrong. Becuase i could not hide the columns. I got the guid using F12 in Chrome and i used the data-index as a nth-child. Was that not correct?
  • Geoff_RossGeoff_Ross Cireson Consultant O.G.
    Thomas,

    The value for nth child is just the column number.
    What grid and which column are you trying to hide, I'll check the numbers for you.

    Geoff
  • Thomas_StrombergThomas_Stromberg Premier Partner Advanced IT Monkey ✭✭✭
    Thomas,

    The value for nth child is just the column number.
    What grid and which column are you trying to hide, I'll check the numbers for you.

    Geoff
    I am trying to hide the category column 
Sign In or Register to comment.