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

Accessing Bound Model Values in Popup Template

1 Answer 384 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 28 Apr 2014, 10:02 PM
Hi,

I have a grid of records that are editable (popup). 

When I click edit and launch the popup editor template I have another grid that is populated by passing a value to a controller method. I'm trying to access this value from the ViewModel that the original selected record is built from.

I understand the editor template serialization and there has been a similar question posted here: http://www.telerik.com/forums/model-not-initialized-in-grid-popup-editor-

Does anyone know how to access the bound data from within a template?

Regards

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 30 Apr 2014, 01:27 PM
Hello John,

Inside the popup template you can use all kind of bindings (such as html or value) to display/edit the fields that you need. On a side note you can use the edit event of the grid to get reference to the model (via e.model).

If above is still not a case you can access it through the options of the Grid which is only possible if the Grid is in edit mode:

var model = $("#grid").data("kendoGrid").editable.options.model;

If you are looking for a C# way, as explained in the other thread it is not possible.

Kind Regards,
Petur Subev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or