【问题标题】:How to display rows count in ag-grid?如何在 ag-grid 中显示行数?
【发布时间】:2019-08-27 02:21:43
【问题描述】:

如何显示 ag-grid 行的行数?

我已尝试挂钩 modelUpdated 事件,但未调用该事件。

我想在页面加载和每行更改时显示行数。

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

【问题讨论】:

    标签: vue.js ag-grid


    【解决方案1】:

    vue 中,将@ 用于事件,而不是:

    这里的代码有效:

    <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();
    }
    

    【讨论】:

      猜你喜欢
      • 2016-08-02
      • 2020-02-24
      • 2017-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-31
      • 2019-10-04
      • 2019-10-18
      相关资源
      最近更新 更多