Kendo Popup Display

MVC4, a kind of razor. I can open the details window for the Kendo grid item (Ajax) using the client template, and this works. My problem is that I lose the state of the grid (sorting / ordering, etc.) when I return to the grid.

My thought was to use a popup to display the detail of the mesh element. I see how to create an edit popup, but I want to display the details without being editable.

I cannot create a custom command since I am using an Ajax data source.

Any ideas on how I can open a window with detailed information, and not lose the state of the grid or pop up only the information window (using razor syntax, please).

thanks

+4
source share
1 answer

The trick is to use an editor template. If you configured your grid as bound to the MyType type:

 @(Html.Kendo().Grid<MyType>().Name("my-grid")) 

you just need to add a new folder to the same view folder with the name EditorTemplates (if you always donโ€™t have it, usually you have one such folder in the Shared folder used for Kendo templates) and paste the view that you want to display in the popup window:

 @model MyType <div class="display-label">@Html.LabelFor(m => m.Name)</div> <div class="display-field">@Html.DisplayFor(m => m.Name)</div> 

etc.

0
source

Source: https://habr.com/ru/post/1447635/


All Articles