E
E
Eugene2021-02-24 10:31:54
Vue.js
Eugene, 2021-02-24 10:31:54

How to pass data to Revo Grid table component?

Good day.
I was looking for various solutions for displaying tables in an application on vue.
I came across a very good Revo Grid plugin
https://revolist.github.io/revogrid/guide/framewor...

Who is familiar with this plugin, please share your experience.

I need to display a component inside the cell and pass data received from the server via API to it.
The documentation makes it clear how to display the component in the column cells, but I still did not understand how to pass data to the component of each cell.

Here is the code

<template>
<div class="my-table">
<v-grid
        :source="table.rows"
        :columns="table.columns"
        resize="true"
        row-size="70"
      ></v-grid>
</div>
</template>

export default {
name: 'MyTable',
data() {
    return {
table: {
        columns: [
          {
            prop: 'name',
            name: 'Название,
            size: 320,
            pin: 'colPinStart',
            cellTemplate: VGridVueTemplate(CellNameAndComment),
          },
          {
            prop: 'contractors',
            name: 'Контрагенты',
            size: 280,
          },
        ],
        rows: [
          {
            name: 'Название в колонке 1',
            contractors: 'ООО "Ромашка 1"',
          },
          {
            name: Название в колонке 2',
            contractors: 'Ромашка 2',
          },
        ],
      },
}
}
}


With cellTemplate, you can pass a component or html template inside a cell.
CellNameAndComment - the component that is passed to the cells of the column.

CellNameAndComment - must take values ​​passed from the server - name and comment.

Please tell me how this can be done. Are there any articles and videos that you can read, is there detailed documentation on working with components in such cases.
Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question