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

How do you combined grid editing with row template

2 Answers 251 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Patrick Rioux
Top achievements
Rank 1
Patrick Rioux asked on 27 Feb 2012, 04:17 PM
Hi,

I have a grid that allows grid edition and I soon as I add the grid template, I'm no longer be able to edit the cell withing the grid.
Unfortunately I found examples of each of one but not the two mixed together.

I specify the row template like this:
rowTemplate: $.proxy(kendo.template($("#rowTemplate").html()), ds),

The only reason I need the row template in this case is to provide the necessary CSS (text-align:right) to align amount field column.
Maybe this could be achieved in a different way?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 28 Feb 2012, 05:42 PM
Hello Patrick,

It is not recommended to use row templates in editable grid. A better approach is defining a column template. In this way you would be able to attach the necessary styling rules and use the editing function.
{ field: "theField", width: "150px", template: '<div style="text-align:right;">#= theField #</div>' }

I hope this will solve you problem.

Greetings,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Patrick Rioux
Top achievements
Rank 1
answered on 28 Feb 2012, 09:11 PM
Thanks it work perfectly!
Tags
Grid
Asked by
Patrick Rioux
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Patrick Rioux
Top achievements
Rank 1
Share this question
or