Update the value of a single cell when using templated content

As per the subject line, I am trying to update the value of a single cell in the data grid where the cells are rendered using a template.

I have tried setCellValue and updateCell, neither of these update the rendered display.

Can you give an example of how to do this please?


3 Replies

JS Johnson Soundararajan S Syncfusion Team April 23, 2024 11:34 AM UTC

Hi Kevin Lane,


Greetings from the Syncfusion support,


When attempting to edit the template cell using the functions setCellValue and updateCell, the updated data is not displayed in the template cell. We have tried to create a sample based on the information you provided, but we are unable to reproduce the reported problem. Additionally, it is necessary to have a primary key assigned to one of the columns.


Please refer to the below sample and documentation for more information.


Sample : 9vmlcb (forked) - StackBlitz


Documentation Link :


setCellValue : Vue Grid API component - Syncfusion

updateCell :   Vue Grid API component - Syncfusion


If you are still experiencing the problem, please share with us your attempts to reproduce the reported issue using the attached sample.


Regards,

Johnson Soundararajan S



KL Kevin Lane April 23, 2024 12:13 PM UTC

Thankyou for this investigation, this helped me to understand that the reason it wasn't working for me was that the primary key column is case sensitive.


My data had a property of "id" but i was using "Id" for the field name in the primary key column.

This worked for displaying the data in the grid but not for using setCellValue.


Changing my code to use field="id" headerText="Id" ​instead of field="Id"​ resolved this.



JS Johnson Soundararajan S Syncfusion Team April 24, 2024 03:25 PM UTC

Hi Kevin Lane,
 

We are delighted to hear that your issue has been resolved. Please feel free to contact us if you need any other assistance.
 

Regards,

Johnson Soundararajan S

 


Loader.
Up arrow icon