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

Cell value update on checkbox click

3 Answers 206 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ruben
Top achievements
Rank 1
Ruben asked on 23 Jul 2015, 08:43 PM

Hello,

1. I am trying implement functionality of updating cell value on checkbox click. For example, if checkbox in checked, the tax should be added to the total.

2. Also, Total field should read only and in currency format.
For some reason, when Total type is number - “edit” function is not working, if Total type is string - “edit” function is ok, but currency format is lost.

Thank you for your help.

http://jsfiddle.net/gdouauyw/7/​

3 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 27 Jul 2015, 12:17 PM
Hello Ruben,

Displaying a formatted, read-only value could be done using a template. For example: 
{ template: "#=kendo.toString(Total, 'c2') || ''# "},
Adding the Tax could be done by getting the Grid's dataItem and setting the desired value to the Total field. You can do this once the checkbox's change event is triggered or when the Grid's save event is triggered.

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
Ruben
Top achievements
Rank 1
answered on 27 Jul 2015, 03:19 PM

Hello Alexander,

Thank you for your reply. Unfortunately it is not working, Total field is not read only: http://jsfiddle.net/gdouauyw/8/

Thank you for your help.
0
Alexander Popov
Telerik team
answered on 29 Jul 2015, 09:53 AM
Hi Ruben,

It is still editable, because the column's field option is set. Using a template only should do the trick: 
{       /*field: "Total", */
     title: "Total"
     format: "{0:C}",
     template: "#= kendo.toString(Total, 'C2') || '' #",
     footerTemplate: "#= kendo.toString(sum, 'C') #"
   },

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
Grid
Asked by
Ruben
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Ruben
Top achievements
Rank 1
Share this question
or