i created a kendo Tabstrip in a kendo popup window as it's shown here:
@model NeoPaie.ViewModels.GrilleSalaireVM
@using Kendo.Mvc.UI;
@using NeoPaie.ViewModels;
<div class="popupError"></div>
@(Html.Kendo().TabStrip()
.HtmlAttributes(new { style = "width:430px;height:400px" })
.Name("tabstrip")
.SelectedIndex(0)
.Items(items =>
{
items.Add()
.Text("Grille De Salaire")
.Content(@Html.Partial("Gestion De La Grille").ToHtmlString());
items.Add()
.Text("Fiche Administartive")
**.LoadContentFrom("Liste", "GrilleRubriqueFixe");**
})
)
2 番目のタブで、GrilleRubriqueFixe****listを表示したい: クラッド メソッドを含む剣道グリッド: しかし、この例外が発生しました: The model item passed into the dictionary is of type 'System.String', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable
1[NeoPaie.ViewModels.GrilleSalaireVM]'` is not possible to use another Model in the secondタブ??どうすればこれを修正できますか??
`
私のGrilleRubrickFixeリストがあります:`
@model IEnumerable<NeoPaie.ViewModels.GrilleRubriqueFixeVM>
@using Kendo.Mvc.UI;
@{
ViewBag.Title = "Rubrique Fixes";
}
@section headerView {
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
<link href="@Url.Content("~/Content/Edit.css")" rel="stylesheet" />
<script type="text/javascript" src="~/Scripts/Common/Edit.js"></script>
}
<h2>Rubrique Fixes</h2>
@(Html.Kendo().Grid(Model)
.Name("Grid")
.HtmlAttributes(new { style = "width:500px;height:300px" })
.Editable(editing =>
{
editing.Mode(GridEditMode.InCell).TemplateName("PopupEditors/PopupGrilleRubriqueFixe")
.Window(w => w.Title("NeoPaie : Ajouter/Modifier une RubriqueFixe").Width(400).Height(350));
editing.DisplayDeleteConfirmation("Êtes-vous sûr de vouloir supprimer RubriqueFixe?");
})
.ToolBar(commands =>
{
commands.Create().Text("Ajouter").HtmlAttributes(new { style = "width:100px;float:right" });
})
.DataSource(dataSource => dataSource
.Ajax()
.Read("Read", "GrilleRubriqueFixe")
.Create("Save","GrilleRubriqueFixe")
.Update("Save", "GrilleRubriqueFixe")
.Destroy("Delete", "GrilleRubriqueFixe")
.Model(model => model.Id(p => p.Grille_Rubrique_FixeId))
.Events(e => e.RequestEnd("OnKendoGridSaveEnd").Error("OnKendoGridPopupListSaveError"))
)
.Columns(columns =>
{
columns.Bound(p => p.Grille_Rubrique_FixeId).Groupable(false).Hidden();
columns.Bound(p => p.CODE).Width(50).Title("Rubrique");
columns.Bound(p => p.VALEUR).Width(100).Title("Valeur");
columns.Bound(p => p.LIBELLE).Width(300).Hidden();
columns.Bound(p => p.RubriqueId).Width(100).Hidden();
columns.Bound(p => p.GrilleId).Width(100).Hidden();
columns.Command(command => command.Destroy().Text(" ")).Width(60).Title("Supprimer").HtmlAttributes(new { style = "text-align:center" });
columns.Command(command => command.Edit().Text(" ")).Width(60).Title("Modifier").HtmlAttributes(new { style = "text-align:center" });
})
.Scrollable()
.Selectable(selectable => selectable
.Mode(GridSelectionMode.Single)
.Type(GridSelectionType.Row))
.Navigatable()
)
and my GrilleRubriqueFixe Controller:
public ActionResult Liste( ) { 試行 {
List<GrilleRubriqueFixeVM> lstVM = ServiceApplicatif.GetListe().OrderBy(x => x.RubriqueId).ToList();
// Drop Down List des listRubrique
IEnumerable<RubriqueVM> listRubrique = RefDataManager.GetRefData<RubriqueVM>() as IEnumerable<RubriqueVM>;
ViewData["CodeRubrique"] = new SelectList(listRubrique, "RubriqueId", "CODELIBELLE");
return PartialView(lstVM);
}
catch (Exception ex)
{
LoggerGrilleRubriqueFixe.Error(string.Format("Exception : {0}", ex.Message.ToString()));
throw new Exception("Erreur lors du chargement.");
}
}
[HttpPost]
public JsonResult Read([DataSourceRequest] DataSourceRequest dsRequest)
{ try { // ドロップダウン リスト des listRubrick
IEnumerable<RubriqueVM> listRubrique = RefDataManager.GetRefData<RubriqueVM>() as IEnumerable<RubriqueVM>;
if (listRubrique.Any())
{
ViewBag.idrub = listRubrique.First().RubriqueId;
}
ViewData["Rubrique"] = new SelectList(listRubrique, "RubriqueId", "CODELIBELLE");
List<GrilleRubriqueFixeVM> lstVM = ServiceApplicatif.GetListe().OrderBy(x => x.GrilleId).ToList();
return Json(lstVM.ToDataSourceResult(dsRequest));
}
catch (Exception ex)
{
LoggerGrilleRubriqueFixe.Error(string.Format("Exception : {0}", ex.Message.ToString()));
throw new Exception("Erreur lors du chargement.");
}
} `