Question: use different data model for grid
See original GitHub issueI would like to use product information in my grid. Is it possible to use these array values? The row would be used for the y value and the column for the x value.
var products = [
{
name: 'Integer posuere erat a ante venenatis dapibus posuere velit aliquet.',
row: 1,
column: 1,
width: 1,
height: 1
},
{
name: 'Integer oudawdawhuadhouwhoudw ahdowhodaw hoadwou',
row: 1,
column: 2,
width: 1,
height: 1
}
];
If I try to use it like this I get an error.
<grid-item v-for="item in layout"
:x="item.row"
:y="item.column"
:w="item.width"
:h="item.height"
:i="item.name">
{{item.i}}
</grid-item>
This is the error:
[Vue warn]: Error in nextTick: "Error: VueGridLayout: Layout[0].x must be a number!"
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top Results From Across the Web
How to Combine Separate Questions into a Grid in Q
Right-click and select Set Question. Give the new question a Name like “Brand Attitude” and set the Question Type to Pick Any –...
Read more >Questions about Relationships, the Data Model, and Data ...
The data grid shows row data for each table's level of detail. In the Data pane, fields and calculated fields are automatically organized...
Read more >How to model a "grid" in a database? - Stack Overflow
I need to build a component, so that a user can define how many columns and rows the answer for his/her question should...
Read more >1: Viewing a grid in the Short Drinks sample
For more information, see Restoring the Short Drinks sample database. The Short Drinks survey contains several grid questions. A grid question can be ......
Read more >How can I pass a view model with multiple models in ... - Telerik
I got multiple grids in one view, and each grid shows different infos depends on the model, I'll use a simple model as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It makes sense. I will try to implement something similar. Thanks for the explanation.
Here is an example i was getting data from server like this layout = [{“name”:1,config : {“x”:0,“y”:0,“i”:2,“h”:3,“w”,3}}]
And in my grid layout i was mapping data in this way
</grid-item>`
<grid-item
v-for="(item,
i) in layout":key="i"
:x="item.config.x"
:y="item.config.y"
:w="item.config.w"
:h="item.config.h"
:i="item.config.i"
>
{{item.config.i}}above code giving me this error - [Vue warn]: Error in nextTick: “Error: VueGridLayout: Layout[0].x must be a number!”
so i made my layout element like this
var layout = [{"x":0,"y":0,"i":2,"h":3,"w",3}];
<grid-item
v-for="(item,
i) inlayout"
{{item.i}}
</grid-item>
`` here only one root/parent object is there it solved my problem