[英]AG-Grid Header Cell Selection
Ag-grid 文檔中有一個標題復選框選擇示例。
標題復選框選擇
可以在標題中有一個復選框以供選擇。 要將列配置為具有復選框,請設置 colDef.headerCheckboxSelection=true。 headerCheckboxSelection 也可以是一個函數,如果您希望復選框有時出現(例如,如果列在網格中排在第一位)。
// the name column header always has a checkbox in the header
colDef = {
field: 'name',
headerCheckboxSelection: true
...
}
// the country column header only has checkbox if it is the first column
colDef = {
field: 'country',
headerCheckboxSelection: function(params) {
var displayedColumns = params.columnApi.getAllDisplayedColumns();
var thisIsFirstColumn = displayedColumns[0] === params.column;
return thisIsFirstColumn;
}
...
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.