Creating a table using two document types: 1 for main row. 1 for hidden sub-row
I'm creating a table on a webpage which is for sports results. So a simple table with 2 teams and the score.
ie. France 2 - 2 Germany
This is setup as an eventMatch document type with teamName properties etc.
What I want to be able to do, is when you click on a match result a hidden row beneath it becomes visible and it displays statistics from the match which are in a Child document type (matchStatistics) of the eventMatch
This is some of what I have so far:
@{
var Homepage = CurrentPage.AncestorsOrSelf(1).FirstOrDefault();
var pageSize = 20;
if (Model.Content.HasValue("numberOfItemsPerPage"))
{
pageSize = Model.Content.GetPropertyValue<int>("numberOfItemsPerPage");
}
var pageItems = Homepage.Descendants("eventMatch");
var page = 1; int.TryParse(Request.QueryString["page"], out page);
var totalPages = (int)Math.Ceiling((double)pageItems.Count() / (double)pageSize);
if (page > totalPages)
{
page = totalPages;
}
else if (page < 1)
{
page = 1;
}
This is the output so far. I have some fake results in to show as an example and the grey row is the hidden row where I'd like the statistics to come up.
Creating a table using two document types: 1 for main row. 1 for hidden sub-row
I'm creating a table on a webpage which is for sports results. So a simple table with 2 teams and the score.
ie. France 2 - 2 Germany
This is setup as an eventMatch document type with teamName properties etc.
What I want to be able to do, is when you click on a match result a hidden row beneath it becomes visible and it displays statistics from the match which are in a Child document type (matchStatistics) of the eventMatch
This is some of what I have so far:
@{ var Homepage = CurrentPage.AncestorsOrSelf(1).FirstOrDefault();
}
This is the output so far. I have some fake results in to show as an example and the grey row is the hidden row where I'd like the statistics to come up.
Any help would be most appreciated. Thanks! :)
is working on a reply...