internal static bool Sortable(this GridFilteringModes modes) { return((modes & GridFilteringModes.Sort) == GridFilteringModes.Sort); }
internal static bool Steppable(this GridFilteringModes modes) { return((modes & GridFilteringModes.StepInto) == GridFilteringModes.StepInto); }
public MessagingStepGridModel(HtmlHelper html, Filiation filiation, GridFilteringModes modes) { Attributes(@class => "messaging-step"); Column.For( s => html.ActionLink( s.Name ?? Resource.Unknown, "Details", "MessagingStep", new RouteValueDictionary(new { id = s.ActivityID }), new Dictionary <string, object> { { "data-ajax-grid", "true" } }) ) .Named("Port Name") .Sortable(modes.Sortable(), s => s.Name) .Filterable(modes.Steppable(), s => s.Name); // TODO Column.For(s => s.MessageBody.IsNullOrEmpty() ? null : Html.ActionButton("Save", "Save", "MessagingStep", new { id = s.ActivityID })) Column.For(s => html.ActionButton("Download", "Save", "MessagingStep", new { id = s.ActivityID })) .Named("Body Action") .Encode(false) .Sortable(false); if (modes.Sortable() && filiation != Filiation.Orphan) { Column.For(s => html.ActionLink("Process", "Process", "MessagingStep", new { id = s.ActivityID }, null)) .Named("Go to...") .Encode(false) .Sortable(false); } Column.For(s => s.Value1) .Named("Value 1") .Sortable(modes.Sortable()) .Filterable(modes.Sortable()); Column.For(s => s.Value2) .Named("Value 2") .Sortable(modes.Sortable()) .Filterable(modes.Sortable()); Column.For(s => s.Value3) .Named("Value 3") .Sortable(modes.Sortable()) .Filterable(modes.Sortable()); Column.For(s => s.BeginTime.ToLocalTime()) .Named("Time") .Sortable(modes.Sortable(), s => s.BeginTime) .Attributes(s => new Dictionary <string, object> { { "title", s.Item.BeginTime } }); Column.For(s => s.Status) .Sortable(modes.Sortable()) .Filterable(modes.Sortable()); Column.For(s => s.MessageSize) .Sortable(modes.Sortable()); Column.For(s => s.FriendlyMessageType) .Named("Message Type") .Sortable(modes.Sortable(), s => s.MessageType) .Attributes(s => new Dictionary <string, object> { { "title", s.Item.MessageType } }) .Filterable(modes.Sortable(), s => s.MessageType); Column.For(s => s.TransportType) .Sortable(modes.Sortable()) .Filterable(modes.Sortable()); RenderUsing(new DynamicGridRenderer <MessagingStep>()); }