Slick Grid/DataView Objects
Grid & DataView objects through vueGridCreated
vueGridCreated<script setup lang="ts">
import { type Column, Filters, Formatters, SlickgridVue, SlickgridVueInstance } from 'slickgrid-vue';
import { onBeforeMount, type Ref } from 'vue';
const gridOptions = ref<GridOption>();
const columns: 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="columns"
v-model:options="gridOptions"
v-model:dataset="dataset"
@onCellChange="onCellChanged($event.detail.eventData, $event.detail.args)"
@onClick="onCellClicked($event.detail.eventData, $event.detail.args)"
@onValidationError="onCellValidationError($event.detail.eventData, $event.detail.args)"
@onVueGridCreated="vueGridReady($event.detail)"
/>
</div>
</div>
</template>Grid & DataView objects & Services through instances bindable
instances bindableSlickGrid Events (original SlickGrid)
Usage
Last updated