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

Template does not render when grid cell is dirty

2 Answers 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 11 Jul 2014, 08:44 AM

Hi, I'm using Kendo grid in javascript (coffeescript)
I have a boolean grid column with a template functon:

column:
  template: (row) -> if row.booleanField then '<img src="/static/img/yes.png"' else ''

The column is editable, and show a checkbox when editing. After edit, and the cell becomes dirty, template no longer works - the code runs, but the cell does not get the img.

2 Answers, 1 is accepted

Sort by
0
aortega
Top achievements
Rank 2
answered on 11 Jul 2014, 04:45 PM
Since you overwrite the value shown in the grid, you would need to save first - so the template can be reloaded. 

You could try fixing this issue by saving automatically after loosing the focus/editing of the field... 

..or you could try to inject the image as part of the cell in the column...

$('yourcellclass').prepend('<img id="theImg" src="theImg.png" />')

(Just an idea, not tested)
0
Atanas Korchev
Telerik team
answered on 15 Jul 2014, 06:23 AM
Hello,

I tried to reproduce the problem in this demo to no avail. Does it work at your side?

Regards,
Atanas Korchev
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
Tom
Top achievements
Rank 1
Answers by
aortega
Top achievements
Rank 2
Atanas Korchev
Telerik team
Share this question
or