1.對某列進行排序
{headerName: '性別', field: 'gender', sortable: true},
sortable: true對某列進行排序.
2.對所有的列進行排序
<ag-grid-vue class="table ag-theme-blue" :enableSorting="true" ></ag-grid-vue>
:enableSorting="true" 對所有的列進行排序
3.行拖動
a.在第一列設置rowDrag: true
b.在此設置:rowDragManaged="true" <ag-grid-vue class="table ag-theme-blue" :rowDragManaged="true"
></ag-grid-vue>
4.單選
表頭js中 columnDefs 中增加 checkboxSelection: true 就會出現選擇框,這個時候只能單選
5.多選
表頭js中 columnDefs 中增加 checkboxSelection: true
然后在HTML中設置 rowSelection="multiple" 就可以實現多選了
6. 篩選
HTML中 :enableFilter="true"篩選/查找/過濾器
7. 選中行
HTML中 rowSelection="multiple"或rowSelection='single'可以設置選中行后有背景色
Multiple能選多行 single只能選一行
8.列固定
表頭js中 columnDefs 中增加 pinned: 'left'可實現列固定有橫向滾動條時才能看到效果。
9.行高
HTML中加入rowHeight = 50 可以改變除了表頭所有的行高
10.分頁
HTML中加入 :pagination="true"分頁
:paginationPageSize="10"每頁顯示幾條。