Grid colouring for ignored and missing.

pull/3113/head
Mark McDowall 13 years ago
parent 2635ff9bee
commit 78f7b8a53c

@ -268,3 +268,14 @@ button span, input[type="button"] span, input[type="submit"] span, input[type="r
color: rgb(169, 169, 169);
padding: 4px;
}
/* Episode Grid Row Colouring */
.episodeIgnored
{
background-color: #F2F5A9;
}
.episodeMissing
{
background-color: #F5A9A9;
}

@ -1,4 +1,23 @@
function grid_onError(e) {
//Suppress the alert
e.preventDefault();
}
//Highlight rows based on a number of details
function highlightRow(e) {
var row = e.row;
var dataItem = e.dataItem;
var ignored = dataItem.Ignored;
var status = dataItem.Status;
if (ignored) {
$(row).addClass('episodeIgnored');
return;
}
if (status == "Missing") {
$(row).addClass('episodeMissing');
return;
}
}

@ -106,6 +106,7 @@ function toggleMasters(seasonNumber, ignored) {
//Functions called by the Telerik Season Grid
function grid_rowBound(e) {
var dataItem = e.dataItem;
var row = e.row;
var ignored = dataItem.Ignored;
var episodeId = dataItem.EpisodeId;
@ -122,6 +123,8 @@ function grid_rowBound(e) {
if (seriesId == 0)
seriesId = dataItem.SeriesId;
highlightRow(e);
}
function grid_dataBound(e) {

@ -8,7 +8,7 @@
@Html.IncludeCss("Grid.css")
}
@{ ViewBag.Title = Model.Title; }
<style>
<style>
.seasonToggleTopGroup
{
overflow: hidden;

@ -46,6 +46,7 @@
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDateTime).Ascending()).Enabled(true))
.ClientEvents(clientEvents =>
{
clientEvents.OnRowDataBound("grid_rowBound");
if (EnviromentProvider.IsProduction)
clientEvents.OnError("grid_onError");
})
@ -86,6 +87,7 @@
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDateTime).Ascending()).Enabled(true))
.ClientEvents(clientEvents =>
{
clientEvents.OnRowDataBound("grid_rowBound");
if (EnviromentProvider.IsProduction)
clientEvents.OnError("grid_onError");
})
@ -128,6 +130,7 @@
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDateTime).Ascending()).Enabled(true))
.ClientEvents(clientEvents =>
{
clientEvents.OnRowDataBound("grid_rowBound");
if (EnviromentProvider.IsProduction)
clientEvents.OnError("grid_onError");
})
@ -169,9 +172,18 @@
.Sortable(rows => rows.OrderBy(epSort => epSort.Add(c => c.AirDateTime).Ascending()).Enabled(true))
.ClientEvents(clientEvents =>
{
clientEvents.OnRowDataBound("grid_rowBound");
if (EnviromentProvider.IsProduction)
clientEvents.OnError("grid_onError");
})
.Render();}
</div>
</div>
@section Scripts{
<script type="text/javascript">
function grid_rowBound(e) {
highlightRow(e);
}
</script>
}
Loading…
Cancel
Save