This is a migrated thread and some comments may be shown as answers.

update kendo grid cell value on button click

3 Answers 1428 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shahid
Top achievements
Rank 1
Shahid asked on 12 Feb 2014, 11:31 AM
hi i have a small issue what i am trying to do is after i populate my kendo grid, i want to update cell value on button click.

here is the scenario: i have a grid that brings back values from database column names are integer1, integer2 etc and values are 1, 2, ...
what i want to do is on button click(not a kendo toolbar button) change value to may be 10, 20.....dont want to save these values back to the database but just override 1, 2 with 10, 20 etc.

thanks,
Shahid

3 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 14 Feb 2014, 08:24 AM
Hi Shahid,

In case the button is on the same row as the cell that should be modified you could use the following approach:
  1. Add the custom command button and add a click event handler to it
  2. Once the event is triggered get the dataItem 
  3. Use the set method to modify the value

Here is a small example illustrating the above, I hope it helps.

Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Garry
Top achievements
Rank 2
Veteran
answered on 26 Sep 2014, 09:13 AM
Example jsfiddle is broken - 404 when clicking a grid button
0
Alexander Popov
Telerik team
answered on 26 Sep 2014, 09:28 AM
Hello Garry,

It seems that jsBin is injecting wrong base URL. Running the example in a separate tab works as expected.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
General Discussions
Asked by
Shahid
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Garry
Top achievements
Rank 2
Veteran
Share this question
or