# How to add input fields to Eui Data Grid

**URL:** <https://discuss.elastic.co/t/how-to-add-input-fields-to-eui-data-grid/326567>\
**Category:** Kibana\
**Tags:** kibana-plugin-development\
**Created:** [February 27, 2023, 10:42am UTC](https://discuss.elastic.co/t/how-to-add-input-fields-to-eui-data-grid/326567 "2023-02-27T10:42:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sheereen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sheereen/32/122005_2.png) [@Sheereen](https://discuss.elastic.co/u/Sheereen)\
**Post date:** [February 27, 2023, 10:42am UTC](https://discuss.elastic.co/t/how-to-add-input-fields-to-eui-data-grid/326567/1 "2023-02-27T10:42:52Z")

</div>

Hi,

I want to add input fields to my data grid.  
Meaning in total I'll have 10 columns  
After 3 columns data, I need 2 columns as input fields, and the values in the rest of the columns will depend on the values in the input fields in the previous 2 columns

Can I have custom input fields in Eui Data Grid?

Or should I design custom element, like a data grid?

Thanks

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [February 27, 2023, 11:27am UTC](https://discuss.elastic.co/t/how-to-add-input-fields-to-eui-data-grid/326567/2 "2023-02-27T11:27:47Z")

</div>

Hi @Sheereen

I think you can use this example of Eui Data Grid with check boxes as starting point for having inputs on cell: [https://elastic.github.io/eui/#/tabular-content/data-grid-style-display#grid-row-classes](https://elastic.github.io/eui/#/tabular-content/data-grid-style-display#grid-row-classes)

---

<div class="post-metadata">

**Author:** ![Sheereen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sheereen/32/122005_2.png) [@Sheereen](https://discuss.elastic.co/u/Sheereen)\
**Post date:** [February 27, 2023, 12:23pm UTC](https://discuss.elastic.co/t/how-to-add-input-fields-to-eui-data-grid/326567/3 "2023-02-27T12:23:04Z")

</div>

Thanks for the response

I have gone through it  
That is for providing selection contexts for the data in the data grid right?

I want to have input fields in place of values in the datagrid

---

<div class="post-metadata">

**Author:** ![Sheereen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sheereen/32/122005_2.png) [@Sheereen](https://discuss.elastic.co/u/Sheereen)\
**Post date:** [February 27, 2023, 12:54pm UTC](https://discuss.elastic.co/t/how-to-add-input-fields-to-eui-data-grid/326567/4 "2023-02-27T12:54:44Z")

</div>

For my use case, is EuiTable a better option?

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [February 27, 2023, 12:58pm UTC](https://discuss.elastic.co/t/how-to-add-input-fields-to-eui-data-grid/326567/5 "2023-02-27T12:58:07Z")

</div>

In the example it is showing how to handle the context for an input field like the checkbox.  
Same logic applies to other types of input: what challenges are you facing with the implementation? Can you share a codesandbox with some code?

---

<div class="post-metadata">

**Author:** ![Sheereen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sheereen/32/122005_2.png) [@Sheereen](https://discuss.elastic.co/u/Sheereen)\
**Post date:** [March 24, 2023, 8:39am UTC](https://discuss.elastic.co/t/how-to-add-input-fields-to-eui-data-grid/326567/6 "2023-03-24T08:39:39Z")

</div>

I tried to insert textfields in 2 columns,  
by returning \<EuiTextField ... /\> inside renderCellValue() , if column id in [col1, col2].

So these are essentially not control buttons or inputs ([https://elastic.github.io/eui/#/tabular-content/data-grid-schema-columns#control-columns:~:text=Props-,Control%20columns,-Control%20columns%20can](https://elastic.github.io/eui/#/tabular-content/data-grid-schema-columns#control-columns:~:text=Props-,Control%20columns,-Control%20columns%20can))

I am getting the controls, but they loose focus when I enter a character in the field... because renderCellValue() gets called again

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 21, 2023, 8:40am UTC](https://discuss.elastic.co/t/how-to-add-input-fields-to-eui-data-grid/326567/7 "2023-04-21T08:40:16Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
