Skip to content

useGrid

Composable for programmatic access to the grid.

useGrid(selector: string): UseGridReturn<TRow>
NameTypeDescription
selectorstringOptional CSS selector to target a specific grid element via
DOM query instead of using Vue’s provide/inject. Use when the component
contains multiple grids, e.g. 'tbw-grid.primary' or '#my-grid'.
<script setup>
import { useGrid } from '@toolbox-web/grid-vue';
const { forceLayout, getConfig, isReady, getVisibleColumns } = useGrid();
async function handleResize() {
await forceLayout();
}
</script>
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt