I need to make a table with DataGrid in Vue. But I need to display the Data from a v-for as you can see in the code i tried i need to display {{user.name}}, {{user.email}} and {{rol.name}}. And I don't know how to do it. Im pretty new to
I tried different thinks but i don't really know how to do it. Thanks all.
Example:
<DxDataGrid
:columns="columns"
:show-borders="true"
:focused-row-enabled="true">
<div v-for="(user,index) in usersData" :key="index">
<DxColumn caption="Usuario">{{user.name}}</DxColumn>
<DxColumn caption="Email">{{user.email}}</DxColumn>
<span v-for="(rol,index) in user.roles" :key="index">
<DxColumn caption="Roles">{{rol.name}}</DxColumn>
</span>
</div>
</DxDataGrid>
The approach you're taking isn't how
DxDataGridis typically used.Instead of using
v-forwithin theDxDataGrid, you should preprocess your data to fit the structure thatDxDataGridexpects:And then in template:
Hope this helps!