1

I'm using ui-grid 3.2.1. Trying for a long time now to find an event that notifies me when rows are rendered in the DOM. I looked a lot in SO, and in their issues in Github. My test to see if rows are rendered is basically $('.ui-grid-row').length > 0.

I tried rowsRendered event, modifyRows(data), all sorts of $timeout(0) in almost every spot I could, nothing worked, all callbacks are called when the above jQuery still doesn't have results.

As a last resort I found a very inefficient solution - I $watch the .html() changes of .ui-grid-contents-wrapper, which contains the .ui-grid-row elements, and when I find one, I turn off the watcher and call the callback. It's bad but it works.

Note - The rows/columns somtimes contain inner directives which may take some time to render. I don't think it should influence rowsRendered() event.

Please, can anybody help with this? No support from ui-grid team sadly.

EDIT: plunkr that show there are no .ui-grid-row in DOM when rowsRendered() is called: https://plnkr.co/edit/8clwC5hkwhAEjvoLZ6vO?p=preview

nadavelyashiv
  • 309
  • 1
  • 3
  • 12

1 Answers1

1

Try

var rows= gridApi.core.getAllVisibleRows(gridApi.grid);

inside rowsRendered function.

arco444
  • 22,002
  • 12
  • 63
  • 67
Akash
  • 33
  • 1
  • 7