fix(fe): auto fit grid column widths to 100% parent container width
This commit is contained in:
@@ -22,6 +22,9 @@ const rowSelectionOptions = computed(() => props.rowSelection === 'none' ? undef
|
||||
function onRowClicked(event: RowClickedEvent): void {
|
||||
if (event.data) emit('rowSelected', event.data)
|
||||
}
|
||||
function onGridReady(params: { api: { sizeColumnsToFit: () => void } }): void {
|
||||
params.api.sizeColumnsToFit()
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="ks-grid" :aria-busy="props.loading">
|
||||
@@ -32,7 +35,10 @@ function onRowClicked(event: RowClickedEvent): void {
|
||||
:column-defs="columnDefs"
|
||||
:row-selection="rowSelectionOptions"
|
||||
:loading="props.loading"
|
||||
:auto-size-strategy="{ type: 'fitGridWidth' }"
|
||||
:suppress-no-rows-overlay="props.rows.length > 0"
|
||||
@grid-ready="onGridReady"
|
||||
@first-data-rendered="onGridReady"
|
||||
@row-clicked="onRowClicked"
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user