angular-ui/ui-grid

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

Open

#5,103 创建于 2016年2月11日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (2,496 fork)batch import
grid-move-columnshelp wantedtype: enhancement

仓库指标

Star
 (5,395 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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.

贡献者指南