Ag-grid

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"每页显示几条。
posted @ 2019-03-15 15:29  笨笨白  阅读(2806)  评论(0编辑  收藏  举报