I have a form to edit a catalog item. The initial list of catalog items is a Kendo grid and the editor is a popup using a custom template for a catalog item. When the popup is opened, I want to have a grid within this window which will have a list of all of the images attached to this item. I want to set this grid up in such a way that if new images are uploaded from within this window it can be refreshed by going back to the controller and re-querying to get the updated list. My issue is that I am unable to pass the ID of the item that I am currently editing into the controller method. I have tried the following:
But Model.ItemId is always null (along with every other property on the model). I believe this is because the template is being accessed from a grid which isn't explicitly passing the model in to the editor template, so I'm unable to use "Model.property" to get access to the values. So, how do I pass the ID of the object I am working with in the editor template to a method in a the controller in order to pull additional data?
Thanks!
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetItemImages", "CatalogItemMaintenance", new { itemId = Model.ItemId})))
But Model.ItemId is always null (along with every other property on the model). I believe this is because the template is being accessed from a grid which isn't explicitly passing the model in to the editor template, so I'm unable to use "Model.property" to get access to the values. So, how do I pass the ID of the object I am working with in the editor template to a method in a the controller in order to pull additional data?
Thanks!