angular-ui/ui-grid

paginationApi.getLastRowIndex and grid.options.totalItems wrong when filtered and data externally changed

已關閉

#6,897 建立於 2018年11月27日

 (0 則留言) (0 個反應) (0 位負責人)JavaScript (2,496 個分叉)batch import
help wanted

倉庫指標

星標
 (5,395 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

I am using paginationApi.getLastRowIndex() and grid.options.totalItems inside a custom pagination template, done via $templateCache.put('ui-grid/pagination',.

That works in general. However, the results are wrong if two conditions happen:

  • A column filter is active
  • While the column filter is active, the data is externally changed, rendering the filter condition false for at least one row.

The actual result displayed is, in this case, the "maximum" (unfiltered) number of items - as if the filter was not there.

I have created a Plunker: http://next.plnkr.co/edit/i32TV4PrYIJby8Uy?preview

Steps for reproducing error there:

  • Filter for City: "Tokio"

  • Click on "Transfer Maria from Tokio to Paris"

  • Pagination footer wrong

貢獻者指南