Guest User

Untitled

a guest
Mar 21st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.64 KB | None | 0 0
  1. .Columns(columns =>
  2. {
  3. columns.Bound(p => p.MetricID).Hidden();
  4. columns.Bound(p => p.IsHistoryUpdateIfPlannedValueChanged).Title("IsHistoryUpdateIfPlannedValueChanged").Width(100).HtmlAttributes(new { style = "text-align: center;" }).HeaderHtmlAttributes(new { @title = "IsHistoryUpdateIfPlannedValueChanged", style = "text-align: center; font-weight: bold;" }).ClientTemplate("<input type='checkbox' value='' checked='#=IsHistoryUpdateIfPlannedValueChanged#' />");
  5.  
  6. //columns.Bound(p => p.IsLinear).Title(Resources.Performance.IsLinear).Width(60).Sortable(false);
  7. columns.Bound(p => p.PlannedJumpOffValue).Hidden().Title(Resources.Performance.PlannedJumpOffValue).HeaderHtmlAttributes(new { @title = Resources.Performance.PlannedJumpOffValue, style = "text-align: center; font-weight: bold;", @class = "jumpOffA" }).HtmlAttributes(new { style = "text-align: right;" }).ClientTemplate("#= kendo.format("{0:0.0000}", (PlannedJumpOffValue != null)? PlannedJumpOffValue:0 )#");
  8. columns.Bound(p => p.PlannedJumpOffRaw1).Hidden().Title(Resources.Performance.PlannedjumpOffB).HeaderHtmlAttributes(new { @title = Resources.Performance.PlannedjumpOffB, style = "text-align: center; font-weight: bold;" }).HtmlAttributes(new { style = "text-align: right;" }).ClientTemplate("#= kendo.format("{0:0.0000}", (PlannedJumpOffRaw1 != null)? PlannedJumpOffRaw1:0 )#");
  9. columns.Bound(p => p.PlannedTarget).Title(Resources.Performance.Planned).HeaderHtmlAttributes(new { @title = Resources.Performance.Planned, style = "text-align: center; font-weight: bold;", @class = "plannedA" }).HtmlAttributes(new { style = "text-align: right;" }).ClientTemplate("#= kendo.format("{0:0.0000}", (PlannedTarget != null)? PlannedTarget:0 )#");
  10. columns.Bound(p => p.PlannedRaw1).Title(Resources.Performance.PlannedB).HeaderHtmlAttributes(new { @title = Resources.Performance.PlannedB, style = "text-align: center; font-weight: bold;" }).HtmlAttributes(new { style = "text-align: right;" }).ClientTemplate("#= kendo.format("{0:0.0000}", (PlannedRaw1 != null)? PlannedRaw1:0 )#");
  11. columns.Bound(p => p.PlannedTargetStartDate).Title(Resources.Common.StartDate).Width(100).HtmlAttributes(new { style = "text-align: center;" }).HeaderHtmlAttributes(new { @title = Resources.Common.StartDate, style = "text-align: center; font-weight: bold;" });
  12. columns.Bound(p => p.PlannedEndDate).Title(Resources.Common.EndDate).Width(100).HtmlAttributes(new { style = "text-align: center;" }).HeaderHtmlAttributes(new { @title = Resources.Common.EndDate, style = "text-align: center; font-weight: bold;" });
  13. //columns.Bound(p => p.LinearDuration).Title(Resources.Performance.LinearDuration).Column.Hidden = true;
  14. //columns.ForeignKey(p => p.LinearDurationUnitID, Model.MetricDurationUnits, "UnitID", "Unit").Title(Resources.Performance.Unit).Width(100).Column.Hidden = true;
  15. //columns.Command(command => command.Destroy()).Title(Resources.Common.Action).Width(60).HeaderHtmlAttributes(new { @title = Resources.Common.Action, style = "text-align: center; font-weight: bold;" }).HtmlAttributes(new { style = "text-align: center;" });
  16. //columns.Bound(p => p.IsHistoryUpdateIfPlannedValueChanged).Title("IsHistoryUpdateIfPlannedValueChanged").Width(100).HtmlAttributes(new { style = "text-align: center;" }).HeaderHtmlAttributes(new { @title = "IsHistoryUpdateIfPlannedValueChanged", style = "text-align: center; font-weight: bold;" }).ClientTemplate("<input type='checkbox' class='checkboxIsHistoryUpdateIfPlannedValueChanged'/>");
  17.  
  18.  
  19.  
  20. columns.Command(command => command.Custom("Delete").Click("kRemovePlanned")).Title(Resources.Common.Action).Width(50).HeaderHtmlAttributes(new { @title = Resources.Common.Action, style = "text-align: center; font-weight: bold;" }).HtmlAttributes(new { style = "text-align: center;" });
  21. })
  22. .ToolBar(toolBar =>
  23. {
  24. toolBar.Template("<a id='kAddPlanned' class='k-grid-add' href='#'><i class='fa fa-plus-square'></i>&nbsp;" + Resources.Performance.AddPlannedValues + "</a>");
  25. toolBar.Save().HtmlAttributes(new { @style = "display:none" }); // The "save" command saves the changed data items
  26. })
  27. .Editable(editable => { editable.Mode(GridEditMode.InCell); })// Use in-cell editing mode
  28.  
  29. .DataSource(dataSource => dataSource.Ajax()
  30. .Batch(true) // Enable batch updates
  31. .Model(model =>
  32. {
  33. model.Id(p => p.MetricPlannedId);
  34. //model.Field(p => p.LinearDurationUnitID).DefaultValue(0);
  35. model.Field(p => p.MetricID).DefaultValue(0);
  36.  
  37. })
  38. .ServerOperation(false)
  39.  
  40. // Configure CRUD -->
  41. .Update(update => update.Action("Update", "Home"))
  42.  
  43.  
  44. // <-- Configure CRUD
  45. )
  46. .Events(e =>
  47. {
  48. e.DataBound("kDataBoundPlanned");
  49. //e.Remove("kRemovePlanned");
  50. e.Save("kSavePlanned");
  51. e.Edit("kEditPlanned");
  52. })
  53. .Scrollable(src => src.Height(120)).Navigatable().Sortable()
  54. )
  55.  
  56.  
  57. @Html.HiddenFor(m => m.PlannedValuesJSON, new { @id = "hdnPlannedValues" })
  58. @Html.HiddenFor(m => m.PlannedVaueJSONBeforeEdit, new { @id = "hdnPlannedValuesBeforeEdit" })
  59. @Html.HiddenFor(m => m.flag, new { @id = "hdnFlag" })
  60. </div>`
Add Comment
Please, Sign In to add comment