Slick Grid/DataView Objects
Grid & DataView objects through vueGridCreated
vueGridCreated<script setup lang="ts">
import { type Column, Filters, Formatters, OperatorType, SlickgridVue, SlickgridVueInstance } from 'slickgrid-vue';
import { onBeforeMount, type Ref } from 'vue';
const gridOptions = ref<GridOption>();
const columnDefinitions: Ref<Column[]> = ref([]);
const dataset = ref<any[]>([]);
const isAutoEdit = ref(true);
let vueGrid: SlickgridVueInstance;
onBeforeMount(() => {
defineGrid();
});
function defineGrid() {}
function vueGridReady(vGrid: SlickgridVueInstance) {
vueGrid = vGrid;
}
/** Change dynamically `autoEdit` grid options */
function setAutoEdit(autoEdit) {
isAutoEdit.value = autoEdit;
vueGrid.grid?.setOptions({ autoEdit }); // change the grid option dynamically
return true;
}
function collapseAllGroups() {
vueGrid.dataView?.collapseAllGroups();
}
function expandAllGroups() {
vueGrid.dataView?.expandAllGroups();
}
</script>
<template>
<div id="demo-container" class="container-fluid">
<div class="col-sm-6">
<label class="me-1">autoEdit setting:</label>
<span id="radioAutoEdit">
<label class="radio-inline control-label me-1" htmlFor="radioTrue">
<input
type="radio"
name="inlineRadioOptions"
id="radioTrue"
defaultChecked={this.state.isAutoEdit}
@input="setAutoEdit(true)"
/>
ON (single-click)
</label>
<label class="radio-inline control-label" htmlFor="radioFalse">
<input
type="radio"
name="inlineRadioOptions"
id="radioFalse"
@input="setAutoEdit(false)"
/>
OFF (double-click)
</label>
</span>
</div>
<div class="col-sm-12">
<SlickgridVue
grid-id="grid3"
v-model:columns="columnDefinitions"
v-model:options="gridOptions"
v-model:data="dataset"
onvueGridCreated="vueGridReady(e.detail)"
onCellChange="onCellChanged(e.detail.eventData, e.detail.args)"
onClick="onCellClicked(e.detail.eventData, e.detail.args)"
onValidationError="onCellValidationError(e.detail.eventData, e.detail.args)"
/>
</div>
</div>
</template>Grid & DataView objects & Services through instances bindable
instances bindableSlickGrid Events (original SlickGrid)
Usage
Last updated