angular-ui/ui-grid

Not able to toggle column moving on if grid initialized with column moving off

Open

#5103 aperta il 11 feb 2016

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (2496 fork)batch import
grid-move-columnshelp wantedtype: enhancement

Metriche repository

Star
 (5395 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

I have an issue that is partly related to #4076.

I have a grid that allows moving some columns but I need it to start in a read-only state (and not allow moving columns or editing until the user clicks an edit link).

I have tried toggling the enableColumnMoving flag on both the gridOptions and columnDefs. I have tried doing it via the column.setPropertyOrDefault method and also updateColumnDef. I've tried using grid.refresh() after making the changes.

If the columns begin their life with enableColumnMoving=false, absolutely nothing seems to enable moving. If I initialize the grid with it set to true, I can turn it on and off but I can't find any reliable way to know when the grid is fully initialized so that I can turn the flag off (it needs to be read only initially).

Also, if I initialize the grid with column moving enabled and then disable it, it still allows the user to drag the columns. It seems that it just doesn't actually perform the move. I would like to see it actually turn off column moving so the user doesn't get the impression that they can move when they shouldn't be able to.

Guida contributor