Hello,
I have a problem with Tabs. In my first page i have a Tab with an item.
In this item there is a grid.
@(
Html.EJ().Tab("TabMenu").Items(data =>
{
data.Add().ID("TabListConsumer").Text("Consumer").ContentTemplate(@<div>
@(Html.EJ().Grid<ConsumerView>("gridConsumer")
.Datasource((IEnumerable<ConsumerView>)Model.myList)
.AllowScrolling(true)
.AllowSorting(true)
.AllowMultiSorting(true)
.AllowResizeToFit(true)
.AllowResizing(true)
.AllowFiltering(true)
.FilterSettings(fs => fs.FilterType(FilterType.Menu))
.IsResponsive(true)
.EnableResponsiveRow(true)
.Locale("fr-FR")
.Columns(col =>
{
col.Field("id").HeaderText("id").TextAlign(TextAlign.Left).Width(60).Add();
col.Field("name").HeaderText("Name").TextAlign(TextAlign.Left).Width(200).Add();
col.Field("firstName").HeaderText("firstName").TextAlign(TextAlign.Left).Width(200).Add();
}).ClientSideEvents(ev =>
ev.RecordDoubleClick("ViewDetails")))
</div>);
}).ShowCloseButton(true)
)
Controller to show data :
ObjectUIConsumer objectUI = new ObjectUIConsumer();
objectUI.myList.Add(new ConsumerView(){id = "1", name = "Smith",
firstName = "Jon"});
objectUI.myList.Add(new ConsumerView(){id = "2", name = "Smith",
firstName = "Cindy"});
objectUI.myList.Add(new ConsumerView(){id = "3", name = "Adams",
firstName = "Alison"});
objectUI.myList.Add(new ConsumerView(){id = "4", name = "Richard",
firstName = "Rose"});
return View(objectUI);
When i double click on a record, i create a new tab, for detail informations.
function ViewDetails()
{
var mysRowSelect =
$("#gridConsumer").data("ejGrid").getSelectedRecords()[0];
var action = "@Url.Action("Index", new { controller =
"DetailConsumer", area = "", id = "MYID" })".replace("MYID",
$("#gridConsumer").data("ejGrid").getSelectedRecords()[0].id);
$("#TabMenu").ejTab("addItem", action, mysRowSelect.name + " "
+ mysRowSelect.firstName);
$("#TabMenu").ejTab({ selectedItemIndex:
$("#TabMenu").ejTab("instance")["anchors"].length - 1 });
}
In this tab i also have a grid.
@(Html.EJ().Grid<ConsumerView>("gridFriend")
.Datasource((IEnumerable<ConsumerView>)Model.myFriendsList)
.AllowScrolling(true)
.AllowSorting(true)
.AllowMultiSorting(true)
.AllowResizeToFit(true)
.AllowResizing(true)
.AllowFiltering(true)
.FilterSettings(fs => fs.FilterType(FilterType.Menu))
.IsResponsive(true)
.EnableResponsiveRow(true)
.Locale("fr-FR")
.Columns(col =>
{
col.Field("id").HeaderText("id").TextAlign(TextAlign.Left).Width(60).Add();
col.Field("name").HeaderText("Name").TextAlign(TextAlign.Left).Width(200).Add();
col.Field("firstName").HeaderText("firstName").TextAlign(TextAlign.Left).Width(200).Add();
}))
Controller to charge this view :
public ActionResult Index(string id)
{
ObjectUIFriends myFriends = new ObjectUIFriends();
myFriends.myFriendsList.Add(new ConsumerView() { id = "34",
name = "Bacon", firstName = "Kevin" });
myFriends.myFriendsList.Add(new ConsumerView() { id = "72",
name = "Simpson", firstName = "Bart" });
return PartialView(myFriends);
}
My problem is that the second grid do not display in the screen. There is no log in
console.
In attachement, i have a project with my problem.
Thanks for you help,
Cholet
Attachment:
TestTab01_3f015362.rar