Replies: 26 comments 1 reply
-
Hey @bbbford, it's a nice feature to have. |
Beta Was this translation helpful? Give feedback.
-
Thanks @revolist. How would one create a column with some action buttons and handle the click events? |
Beta Was this translation helpful? Give feedback.
-
@bbbford hey, what exactly are you referring to? https://revolist.github.io/revogrid/guide/column.customHeader.html
|
Beta Was this translation helpful? Give feedback.
-
Thank you @revolist! That was what I needed to get going. |
Beta Was this translation helpful? Give feedback.
-
@bbbford , just in case you still consider vue: Still it's recommended to stick with classic approach for better performance. |
Beta Was this translation helpful? Give feedback.
-
Thank you @revolist ! |
Beta Was this translation helpful? Give feedback.
-
@revolist I continue to struggle implementing vue components into the grid. Even your example here fails to compile - https://github.com/revolist/vue-datagrid/releases/tag/v1.2.1 However, what I am really trying to accomplish is to use components from Element UI as my Cell Editor. For example, I want to use this date picker when editing a date cell - https://element.eleme.io/#/en-US/component/date-picker Any guidance on how I could accomplish this? |
Beta Was this translation helpful? Give feedback.
-
@bbbford ,
|
Beta Was this translation helpful? Give feedback.
-
I have looked at the column date plugin, but am left confused. I will study it some more. It would be nice to be able to use any vue component as custom editor, without having to create a plugin, like so -
|
Beta Was this translation helpful? Give feedback.
-
Are you using typescript? |
Beta Was this translation helpful? Give feedback.
-
@bbbford about Vue component in cells. I have created a sample for you here: |
Beta Was this translation helpful? Give feedback.
-
@revolist Thank you for this. I really appreciate your willingness to help! I was able to render my vue component as a cellTemplate. Can the same concept be applied to render a vue component as a cell Editor? Attempting to do so, like this, results in TypeError: https://codesandbox.io/s/revogrid-vuecomponent-forked-5xlrs?file=/src/App.vue |
Beta Was this translation helpful? Give feedback.
-
@bbbford in order to create an editor you have to follow rules specified in https://revolist.github.io/revogrid/guide/cell.editor.html We'll provide a common adapter for editors in the nearest future, I have created a draft for you which you can use for your purposes. Just copy the whole editorAdapter.js as it is. https://codesandbox.io/s/revogrid-vueeditor-bxpq0?file=/src/App.vue |
Beta Was this translation helpful? Give feedback.
-
@revolist Brilliant! I'm well on my way now... thanks you!! |
Beta Was this translation helpful? Give feedback.
-
Hey guys, I read all this topic, and while I was thinking of opening an issue, I believe this fits here. |
Beta Was this translation helpful? Give feedback.
-
You can do this, check the documentation. https://revolist.github.io/revogrid/guide/framework.vue.component.html |
Beta Was this translation helpful? Give feedback.
-
Ah sorry. I actually just removed the comment since I realized it is in the documentation. Thanks for the swift reply! |
Beta Was this translation helpful? Give feedback.
-
@bbbford While I got the component to import, and added to columns, it gives an error looks like same as @Tadeu17 has reported. Component fails to work using cellTemplate.
Button.vue
|
Beta Was this translation helpful? Give feedback.
-
For faster reply please provide a sample in online editor, you can fork our sample https://codesandbox.io/embed/data-vue-test-3wkzi?file=/src/App.vue&codemirror=1 |
Beta Was this translation helpful? Give feedback.
-
@revolist Here, quickly copied the code I provided above, same results on this isolated sandbox. |
Beta Was this translation helpful? Give feedback.
-
@timothymarois I see your problem. Initially vue-component template was built with idea of typescript support. Hence to make it work correctly you have to return Vue instance as component, not just structure. https://codesandbox.io/s/sleepy-colden-7c468?file=/src/Button.vue
|
Beta Was this translation helpful? Give feedback.
-
@timothymarois starting from version 2.9.8 you can pass as structure as well: |
Beta Was this translation helpful? Give feedback.
-
Hi @revolist , thanks for all the clear instructions here. My code is organised like yours in this example, where the I could use a Vuex getter with the prop & rowIndex to look that up in the custom component, but I wonder if that will affect performance when I have many rows? |
Beta Was this translation helpful? Give feedback.
-
👆🏽 I figured this out by looking at the Editor example. In addition to The |
Beta Was this translation helpful? Give feedback.
-
Is it possible to translate this code to use react component instead of vue components? |
Beta Was this translation helpful? Give feedback.
-
How could one use a Vue component inside of a cell?
For example, I'd like to put an element-ui button in there for edit/delete/etc. I'd need be able to handle the click event.
I'd also like to use a datepicker component.
This does not seem obvious to me using the cell renderer.
Thanks for all the hard work on this great component!
Beta Was this translation helpful? Give feedback.
All reactions