Jon Sud
Jon Sud

Reputation: 11641

How to display rows count in ag-grid?

How to display rows count of ag-grid rows?

I have tried to hook modelUpdated event but the event is not invoke.

I want to display the rows count when the page is loaded and when every row change.

 <ag-grid-vue
          style="width: 700px;height: 500px;margin:20px 0;"
          class="ag-theme-balham"
          :enableCellChangeFlash="true"
          ...
          rowHeight="55"
          :modelUpdated="onModelUpdated"
        ></ag-grid-vue>

Upvotes: 1

Views: 1980

Answers (1)

Shlomi Levi
Shlomi Levi

Reputation: 3305

In vue, Use @ for events, and not :

Here code that works:

<ag-grid-vue
  style="width: 700px;height: 500px;margin:20px 0;"
  class="ag-theme-balham"
  :enableCellChangeFlash="true"
  ...
  rowHeight="55"
  @modelUpdated="onModelUpdated"
></ag-grid-vue>

onModelUpdated(event) {
  const rowsCount = event.api.getDisplayedRowCount();
}

Upvotes: 2

Related Questions