How to enable editable inline in Data grid 2.

0
Hi All,   I am using Data grid 2 (new one) to show a data in a page (because it provides a filter option just above column). I am looking an option to do inline editable similar to Data grid (old one).   Any suggestion/advice will be great appreciated. Thanks in advance.
asked
3 answers
0

Hi there,

 

I have two solutions that may help.

 

1. Use custom content. You can add a text input by changing a column to custom content. However, this will mean the column is always editable:

image.png

 

2. Add a edit toggle. You can create a non persistable entity that keeps track of if the attribute should be editable. You can use a boolean attribute to show/hide the text input through conditional visibility. This will ensure the editable text box only shows when you click on the text and will return to text when you click outside the text box

image.pngimage.png

 

Hope this helps,

Liam

answered
1

Hi Prakash,

 

As Dhinesh said, its not directly possible as it was possible in Data Grid 1.

However, you can achieve a similiar result by using the Custom Content option to add an Input in the cell. This way you can edit the values, as well as keep filtering and sorting.

 

P.S. Using a view entity with an association to the selected row, you can even show the inputs only if you select the row for editing, and otherwise just show the value as text ;)

 

Hope this helps!

answered
0

Hi Prakash,

     Data grid 2 does not currently support inline editing like the old data grid, You can use List view for inline editing.

answered