146
Views
11
Comments
[OutSystems Data Grid Web] Remove column picker from grid while keeping the column checker
outsystems-data-grid-web
Web icon
Forge asset by OutSystems
Application Type
Traditional Web

Hi everyone,

I want to remove the column picker column, whilst keeping the checkbox column (see image bellow).  


I tried to customize the headersVisibility but when I change from headersVisibility: wijmo.grid.HeadersVisibility.All to headersVisibility: wijmo.grid.HeadersVisibility.Column, both columns (the picker column and the checkbox column) disappear .

Thanks for the help

2020-03-25 15-04-11
João Ferreira
Staff

Hi @Constança Branco,

Thank you for reach us with this question. This is a default behavior we are offering, by now I don't know how difficult is to work-around this, however I want you to know, that we are looking into this to try to unblock you as soon as possible. 

I'll reach you out, when I have more info, sorry for the waiting. 

2021-03-18 21-03-15
Benjith Sam
 
MVP

Hi Constança Branco,

One of the approaches for your use case is to set headersVisibility value to 1

JS Snippet:

Traditional Web:

document.onreadystatechange = function () {
  if (document.readyState == "complete") {
    setHeadersVisibility(1);
  }
}

function setHeadersVisibility(n) {
    GridOS.GridObject[0].grid.headersVisibility = n;
}

Demo Screen: DG_HideRowHeaders

Reactive Web:

GridAPI.GridManager.GetGridById($parameters.GridWidgetId)._provider.headersVisibility = 1;

Demo Screen: DG_HideRowHeaders


I hope this helps you!


Kind regards,

Benjith Sam

2024-07-02 12-36-01
Constança Branco

Hi Benjith,

Thank you for the reply.
This indeed hides the column picker but it will also hide the column checker. I need to keep the column checker and only hide the first column.


2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi @Constança Branco 

For OutSystems Data Grid Web you have a simpler way by using the Advanced Format:

Since you'll be manipulating Wijmo's properties you can find in the documentation all the values that are available (and possible) on the library by looking at this enumerator - HeadersVisibility 

Cheers,
GM

2020-03-25 15-04-11
João Ferreira
Staff

@Constança Branco Unfortunately I couldn't find a way to do it. I haven't found any wijmo example without column filter.

2024-07-02 12-36-01
Constança Branco

Hi Gonçalo,
As I explain above, if I change the header visibility to from All to Column it will hide both columns (the picker column and the checkbox column).
What I want is to keep visible the checkbox column (highlighted in yellow bellow) and delete the column picker (highlighted in red).


When I change the header visibility to Column it will hide both, like demonstrated below:

2024-07-02 12-36-01
Constança Branco

Hi JoĂ£o,

Yeah I also took a look at wijmo's library and didn't find any info on this. I was hoping to find a way of overwriting the constructor of the row headers, but no luck so far.

2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi @Constança Branco 

Sorry I was not clear. I was not providing a solution, just a cleaner alternative for the approach Benjith Sam gave and pointed you to all the options available.

2022-11-12 11-28-30
Gonçalo Martins
Staff

Hi again @Constança Branco 

After doing more research I found together with JoĂ£o this example on Wijmo's side.

As far as I was able to understand, the only way to achieve this is by using the wijmo.grid.selector which is not available on the Traditional web and we don't plan to evolve it in this direction. If you can find a way to include it you could have something like the following snippet (couldn't test it), but with the current version this doesn't seem to be possible, you need to have a custom version to do it I would say:

document.onreadystatechange = function () {
  if (document.readyState == "complete") {
    
    let theGrid = GridOS.GridObject[0].grid;
    setHeadersVisibility(theGrid);
  }
}

function setHeadersVisibility(grid) {
    let selector = new wijmo.grid.selector(grid);
    grid.headersVisibility = wijmo.grid.HeadersVisibility.All;
    selector.column = theGrid.rowHeaders.columns[0];
  
}

Sorry for not being able to unblock this use case. If you're able to solve this please share it with the community, maybe someone in the future will have the same needs.

Cheers,
GM

2022-09-29 13-59-54
AndreRocha

Is there a way to make this work in the reactive version?

2022-07-19 16-56-14
Giuliana Silva
Staff

Hi @AndreRocha,


Please check the answer for this question here.


Cheers,

Giuliana.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.