Oct 31, 2013, 6:02 AM
[CLOSED] Token is not unique error for nested grid
Hi,
I am creating a nested grid and getting following error :
Token is not unique
-------------------
ID = ext.net.global.script.before
TagName = anchor
Match = <#:anchor id='ext.net.global.script.before' />
Following is the code that has StateView as parent grid containing RowExpander. On row expand the Insurer grid needs to be shown as a child. Both StateView and Insurer grids are in different folder.
It is working fine if StateView and Insurer are in the same folder but giving error for different folder.
StateView.cshtml :
I am creating a nested grid and getting following error :
Token is not unique
-------------------
ID = ext.net.global.script.before
TagName = anchor
Match = <#:anchor id='ext.net.global.script.before' />
Following is the code that has StateView as parent grid containing RowExpander. On row expand the Insurer grid needs to be shown as a child. Both StateView and Insurer grids are in different folder.
It is working fine if StateView and Insurer are in the same folder but giving error for different folder.
StateView.cshtml :
@model System.Collections.IEnumerable
@(Html.X().ResourceManager())
@(Html.X().GridPanel()
.ID("stateGrid")
.Split(true)
.Header(false)
.Height(600)
.Cls("x-grid-custom")
.OverflowY(Overflow.Auto)
.Store(
Html.X().Store()
.RemotePaging(true)
.DataSource(Model)
.Model(
Html.X().Model()
.IDProperty("ID")
.Fields(
new ModelField("ID"),
new ModelField("company"),
new ModelField("price"),
new ModelField("change"),
new ModelField("pctChange"),
new ModelField("lastChange")
)
)
.ServerProxy(
Html.X().AjaxProxy()
.Url(Url.Action("StateView"))
)
)
.ColumnModel(
Html.X().Column().Cls("custom-header").Text(StateView.GridHeader_KeyState).DataIndex("company").Flex(2),
Html.X().Column().Cls("custom-header").Text(StateView.GridHeader_ExEnrollPotential).DataIndex("price").Flex(2),
Html.X().Column().Cls("custom-header").Text(StateView.GridHeader_BenchmarkPlan).DataIndex("change").Flex(2),
Html.X().Column().Cls("custom-header").Text(StateView.GridHeader_InsurerMarketShare).DataIndex("pctChange").Flex(2),
Html.X().Column().Cls("custom-header").Text(StateView.GridHeader_PlansFillingToParticipate).DataIndex("lastChange").Flex(2)
).HeaderPosition(Direction.Top)
.Plugins(Html.X().RowExpander()
.Loader(Html.X().ComponentLoader()
.Url(Url.Action("GetInsurer", "Insurer"))
.Mode(LoadMode.Component)
.LoadMask(mask => mask.ShowMask = true)
.Params(ps => ps.Add(new Parameter("id", "this.record.getId()", ParameterMode.Raw)))
)
.Listeners(events =>
{
events.Expand.Handler = "this.grid.doLayout();";
events.Collapse.Handler = "this.grid.doLayout();";
})
)
)
StateViewController.cs : public ActionResult StateView()
{
return View(new object[]
{
new object[] { "1", "California", "aaa", "aaa", "aaa", "aaa" },
new object[] { "2", "New York", "bbb", "bbb", "bbb", "bbb" },
new object[] { "3", "Texas", "ccc", "ccc", "ccc", "ccc" },
new object[] { "4", "Florida", "ddd", "ddd", "ddd", "ddd" },
new object[] { "5", "Illinois", "eee", "eee", "eee", "eee" },
new object[] { "6", "Michigan", "fff", "fff", "fff", "fff" },
new object[] { "7", "North Carolina", "ggg", "ggg", "ggg", "ggg" },
new object[] { "8", "Virginia", "hhh", "hhh", "hhh", "hhh" },
new object[] { "9", "New Jersey", "iii", "iii", "iii", "iii" },
new object[] { "10", "Georgia", "jjj", "jjj", "jjj", "jjj" },
new object[] { "11", "San Diego", "kkk", "kkk", "kkk", "kkk" },
new object[] { "12", "Dallas", "lll", "lll", "lll", "lll" },
new object[] { "13", "San Jose", "mmm", "mmm", "mmm", "mmm" },
new object[] { "14", "Indianapolis", "nnn", "nnn", "nnn", "nnn" },
new object[] { "15", "San Francisco", "ooo", "ooo", "ooo", "ooo" },
new object[] { "16", "Columbus", "ppp", "ppp", "ppp", "ppp" },
new object[] { "17", "Houston", "qqq", "qqq", "qqq", "qqq" },
new object[] { "18", "Detroit", "rrr", "rrr", "rrr", "rrr" }
});
}
Insurer.cshtml : @model System.Collections.IEnumerable
@(Html.X().GridPanel()
.ID("insurerGrid")
.Split(true)
.Header(false)
.Height(400)
.Cls("x-grid-custom")
.OverflowY(Overflow.Auto)
.Store(
Html.X().Store()
.DataSource(Model)
.Model(
Html.X().Model()
.IDProperty("ID")
.Fields(
new ModelField("ID"),
new ModelField("company")
)
)
)
.ColumnModel(
Html.X().Column().Cls("custom-header").Text("Company").DataIndex("company").Flex(1)
).HeaderPosition(Direction.Top)
.View(Html.X().GridView().StripeRows(true))
)
InsurerController.cs : public ActionResult GetInsurer(string id)
{
object[] data = new object[]
{
new object[] { "1", "Insurer 1", "aaa", "aaa", "aaa", "aaa" },
new object[] { "2", "Insurer 2", "bbb", "bbb", "bbb", "bbb" },
new object[] { "3", "Insurer 3", "ccc", "ccc", "ccc", "ccc" },
new object[] { "4", "Insurer 4", "ddd", "ddd", "ddd", "ddd" },
new object[] { "5", "Insurer 5", "eee", "eee", "eee", "eee" },
new object[] { "6", "Insurer 6", "fff", "fff", "fff", "fff" },
new object[] { "7", "Insurer 7", "ggg", "ggg", "ggg", "ggg" },
new object[] { "8", "Insurer 8", "hhh", "hhh", "hhh", "hhh" },
new object[] { "9", "Insurer 9", "iii", "iii", "iii", "iii" },
new object[] { "10", "Insurer 10", "jjj", "jjj", "jjj", "jjj" },
new object[] { "11", "Insurer 11", "kkk", "kkk", "kkk", "kkk" },
new object[] { "12", "Insurer 12", "lll", "lll", "lll", "lll" },
new object[] { "13", "Insurer 13", "mmm", "mmm", "mmm", "mmm" },
new object[] { "14", "Insurer 14", "nnn", "nnn", "nnn", "nnn" },
new object[] { "15", "Insurer 15", "ooo", "ooo", "ooo", "ooo" },
new object[] { "16", "Insurer 16", "ppp", "ppp", "ppp", "ppp" },
new object[] { "17", "Insurer 17", "qqq", "qqq", "qqq", "qqq" },
new object[] { "18", "Insurer 18", "rrr", "rrr", "rrr", "rrr" }
};
return this.ComponentConfig("Insurer", new object[] { data });
}
Please suggest.
Last edited by Daniil; Nov 05, 2013 at 8:36 AM.
Reason: [CLOSED]