你这里有两个问题。首先是这一行:
ContainerId = string.Format("ListSubData_{0}", id)
页面上需要具有此id的元素,以便可以将内容呈现到其中。因此,基本上,您需要将此方法更改为:
public Ext.Net.MVC.PartialViewResult ListSubData(int id)
{
return new Ext.Net.MVC.PartialViewResult
{
RenderMode = RenderMode.AddTo,
Model = id,
ContainerId = "MyContainerId",
WrapByScriptTag = false
};
}
然后将主视图更改为:
@(x.Panel()
.ID("MyContainerId")
.Layout(LayoutType.Fit)
.Items(i =>
<!-- rest of the code -->
第二个问题是局部视图上的存储。而不是使用
.StoreID("MyDataStore")
必须将其移动到网格面板中,如下所示:
@(x.GridPanel()
.ID("MyPanel")
.Store(
x.Store()
.ID("MyDataStore")
.AutoLoad(true)
<!-- rest of the code -->