angular-ui/ui-grid

Single bind breaks grid when row is removed

Open

#5,831 建立於 2016年11月25日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)JavaScript (2,496 fork)batch import
help wanted

倉庫指標

Star
 (5,395 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Within my cell templates I'm using single bind. It works normally, but when I remove a row from my grid I need that all cells that are being displayed to be destroyed and recreated, otherwise my grid gets "full of garbage from other rows".

Using two-way databind works normally, but the browser can't handle my grid. Using single-bind make the trick, everything that I'm using works, I'm just having problem to remove rows in runtime from the grid.

My guess is that the cells are being reused, and I'm using single-bind so the digest cycle is not updating the cells content as it was expected, so I would like to "force it" somehow.

I tried removing the row from the dataset, set it invisible with a rowProcessor, and ng-hide/ng-if on the row (uiGridViewport). After removing the row I tried, refresh(), queueRefresh(), notifyDataChange(), but the cells are never rerendered again. In this issue #2198 it stated that ui-grid doesn't work with single-bind, but it works just fine for me, my problem is just when I remove a row.

貢獻者指南