Dear Syncfusion support,
Prior to vue 3 migration, dependency injection was working with via provide/inject pattern (https://vuejs.org/v2/api/#provide-inject ). But I can't get it to work with the Data Grid component in vue 3.
I was able to get the Sort module "injected" by pushing it into injectedModules array, but that bypasses the provide/inject pattern (see below). Is there a way to use the provide/inject pattern (https://v3.vuejs.org/guide/composition-api-provide-inject.html#using-inject ) when using the composition API and Data grid component?
Sincerely,
Carlos
|
export default {
name: 'App',
components: {
'ejs-grid' : GridComponent,
'e-columns' : ColumnsDirective,
'e-column' : ColumnDirective
},
provide: {grid: [Sort]},
data() {
return {
gridData: employeeData
}
}
} |
Dear Syncfusion,
Your sample worked. I even converted your sample into composition API and can confirm that it works. However, your sample did not work when it was applied to my configuration (I use Vue CLI, Vue 3, typescript and composition API). I attached a simplified version of my configuration with a similar example and modules like sorting and search are still not working.
Thank you,
Carlos
|
[App.vue]
<template>
<div id="nav">
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</div>
<router-view/>
</template>
<script>
import { Search, Sort, Toolbar } from '@syncfusion/ej2-vue-grids';
import { computed, defineComponent, ref } from 'vue';
export default defineComponent({
name: 'App',
provide: {
grid: [Sort, Search, Toolbar],
}
});
</script>
|
Thank you, this was the solution I needed. May I suggest adding this into your Vue 3 tutorial section of your documentation if it's not on there already? In Vue 2, providing the modules in the parent component was not necessary when using a router view. This could help others.
Once again, thank you.
Carlos
Hi Carlos, can u share the way you did provide in composition api?
My code worked providing options way, but for some reason don't work calling provide function in <script setup>
Hi everyone,
I'm also interested if any of you has the solution (same issue).
Hi Luiz / Karam,
Sorry for the late reply.
Currently, the EJ2 Vue Grid does not have complete support for Composition API. We already logged a feature request - “Need add support for Provide/Inject in Vue Custom slot” for this requirement. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. And this feature will be included in any of our upcoming releases.
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.
Feedback: https://www.syncfusion.com/feedback/36677/need-add-support-for-provide-inject-in-vue-custom-slot
We are closing this ticket for now. You can communicate with us regarding the open features any time using the above Feature Report page.
Regards,
Joseph I.