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

MVVM in templates for ListView and Grid editing

1 Answer 106 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
Jaap
Top achievements
Rank 2
Jaap asked on 04 Sep 2012, 11:32 AM
Hello,



I use MVVM style databinding in my templates for the ListView and Grid widget (in case of the Grid I have a template per column).

That works fine, also when switching to edit mode.

The problem is that when I switch back from edit mode to readonly. I can see in the debugger that the template is applied again, but the MVVM binding is not done, so no data is displayed. Using a regular template (no MVVM) would work fine.



(Using Kendo version 2012.1.710)



Regards, Jaap

1 Answer, 1 is accepted

Sort by
0
Jaap
Top achievements
Rank 2
answered on 04 Sep 2012, 12:49 PM
In the Grid I have solved the issue by adding this line at the end of the _displayCell function:

kendo.bind(cell.children(), dataItem);



This solves the problem, at least with 'incell' editing. I have not tested it with 'inline' or 'popup' editing.



Regards, Jaap

Tags
MVVM
Asked by
Jaap
Top achievements
Rank 2
Answers by
Jaap
Top achievements
Rank 2
Share this question
or