[Data Grid Reactive] Does DataGrid support changeing the editable properties of a single cell
Forge component by OutSystems R&D
Application Type
Reactive

I'm He from Suzhou Transcosmos.

Because of the urgency of project, I have a question about Data Grid Reactive.

Does Data Grid Reactive component support changing the editable properties of a single cell?

If it can, could you tell me how to use it ?


Thank you so much!

Have a nice day!

Solution

Hello @He Caixia 

I saw another post from you here and I think they all have the same purpose, so I would suggest you to close them both if my answer solves your problem.

The attached sample is blocking the even rows from being changed, and I think this can help you achieve your needs.

First of all, add a OnReady event to your page:

You will notice, that I added a custom JS block, passing the GridId as a parameter, as we can have multiple grids on the same page you need to inform which grid to handle.

Looking closer to the script:

You will see the highlighted parameter GridID on the Subscribe events, this will register your beginEdit as soon as the grid is Ready to work.

The dataItem property contains the binding for the current row, in other words, you can access the value of all cells from the current row. 

If you wish to validate the column triggering the beginEdit, use the e.getColumn().binding for example. To block cells from being edit you just have to set e.cancel to true.


Hope I could solve your problem

Ricardo Valim

DataGridReactiveBeginningEdit.oml

Your answer  solved  my problem .

Thank you very much.

Hello @He Caixia 

Could you give us more detail about your needs, so I can try to be more assertive for you.

Kind regards,

Ricardo Valim

AllowColumnEdit can allow editing columns but cannot allow editing just a cell.

I wish to prevent editing of a single cell only , but it doesn't seem to have the editable option by cell level.

Thank you.


Solution

Hello @He Caixia 

I saw another post from you here and I think they all have the same purpose, so I would suggest you to close them both if my answer solves your problem.

The attached sample is blocking the even rows from being changed, and I think this can help you achieve your needs.

First of all, add a OnReady event to your page:

You will notice, that I added a custom JS block, passing the GridId as a parameter, as we can have multiple grids on the same page you need to inform which grid to handle.

Looking closer to the script:

You will see the highlighted parameter GridID on the Subscribe events, this will register your beginEdit as soon as the grid is Ready to work.

The dataItem property contains the binding for the current row, in other words, you can access the value of all cells from the current row. 

If you wish to validate the column triggering the beginEdit, use the e.getColumn().binding for example. To block cells from being edit you just have to set e.cancel to true.


Hope I could solve your problem

Ricardo Valim

DataGridReactiveBeginningEdit.oml

Your answer  solved  my problem .

Thank you very much.

Hi @He Caixia 

Great news...I am glad to help, could you mark the answer as "Solved"?

This way you will help other who search for something similar. =D

Ricardo Valim


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.