or
@model IEnumerable<Umki2.Areas.Wlb.ViewModels.VmWlbWeldLogBook>
@(Html.Kendo().Grid(Model)
.Name(
"grid"
)
.DataSource(ds => ds
.Ajax()
.PageSize(20)
.Model(model =>
{
model.Id(a => a.Id);
model.Field(a => a.Id).Editable(
false
);
model.Field(a => a.PID).Editable(
false
);
})
.Create(create => create.Action(
"Grid_Create"
,
"WlbWeldLogBook"
))
.Read(read => read.Action(
"Grid_Read"
,
"WlbWeldLogBook"
))
.Update(update => update.Action(
"Grid_Update"
,
"WlbWeldLogBook"
))
.Destroy(destroy => destroy.Action(
"Grid_Destroy"
,
"WlbWeldLogBook"
))
)
.Columns(p =>
{
p.Command(commands =>
{
commands.Edit();
commands.Destroy();
}).Title(
""
).Width(180).Locked();
p.Bound(c => c.WlbLine).Width(160);
p.ForeignKey(c => c.WlbSpoolId, (System.Collections.IEnumerable)ViewData[
"WlbSpoolId"
],
"Id"
,
"SpoolNo"
).Width(110).Locked(
true
).Lockable(
false
);
p.Bound(c => c.PID).Width(200);
p.Bound(c => c.JointNo).Width(110).Locked(
true
).Lockable(
false
);
p.Bound(c => c.WeldingProcess).Width(200);
p.Bound(c => c.WlbJointLocation).Width(200);
p.Bound(c => c.WlbJointType).Width(200);
p.ForeignKey(c => c.WrhIdentity1Id, (System.Collections.IEnumerable)ViewData[
"WrhIdentityList"
],
"Id"
,
"IdentityNo"
).Width(110);
p.ForeignKey(c => c.WrhIdentity2Id, (System.Collections.IEnumerable)ViewData[
"WrhIdentityList"
],
"Id"
,
"IdentityNo"
).Width(110);
})
.ToolBar(toolbar =>
{
toolbar.Create();
toolbar.Excel();
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.Groupable()
.Filterable(ftb => ftb.Mode(GridFilterMode.Menu))
.Resizable(resizable => resizable.Columns(
true
))
.Scrollable(scrollable => scrollable.Height(430))
.Reorderable(reorderable => reorderable.Columns(
true
))
.ColumnMenu()
.Excel(excel => excel
.FileName(
"LineList_"
+ System.DateTime.Now +
".xlsx"
)
.Filterable(
true
)
.ProxyURL(Url.Action(
"Excel_Export_Save"
,
"Grid"
))
)
)
@model Umki2.Areas.Wlb.Models.WlbLine
@(Html.Kendo().DropDownListFor(m => m)
.AutoBind(
false
)
.OptionLabel(
"Select Line..."
)
.DataTextField(
"LineNo"
)
.DataValueField(
"Id"
)
.DataSource(dataSource =>
{
dataSource.Read(read => read.Action(
"GetLines"
,
"WlbWeldLogBook"
,
new
{ area =
"Wlb"
}))
.ServerFiltering(
true
);
})
)
@Html.ValidationMessageFor(m => m)
public
JsonResult GetLines()
{
return
Json(
db.WlbLine.Select(x =>
new
{
Id = x.Id,
LineNo = x.LineNo
}), JsonRequestBehavior.AllowGet);
}
public
ActionResult Index()
{
ViewBag.WlbSpoolId = db.WlbSpool.ToList();
ViewBag.WrhIdentityList = db.WrhIdentityList.ToList();
return
View();
}
public
ActionResult Grid_Read([DataSourceRequest]DataSourceRequest request)
{
IQueryable<WlbJoint> WlbJoint = db.WlbJoint;
var model = from o
in
db.WlbJoint
select
new
VmWlbWeldLogBook
{
Id = o.Id,
JointNo = o.JointNo,
WeldingProcess = o.WeldingProcess,
WlbJointType = o.WlbJointType,
WlbJointLocation = o.WlbJointLocation,
WlbSpoolId = o.WlbSpoolId,
WrhIdentity1Id = o.WrhIdentity1Id,
WrhIdentity2Id = o.WrhIdentity2Id,
WlbLineId = o.WlbSpool.WlbIsometric.WlbLineId,
PID = o.WlbSpool.WlbIsometric.WlbLine.PID
};
DataSourceResult result = model.ToDataSourceResult(request);
return
Json(result);
}
@(Html.Kendo().LinearGauge()
.Name(
"progressGauge"
)
.Pointer(pointer => pointer
.Value(2.5)
.Shape(GaugeLinearPointerShape.Arrow)
)
.Scale(scale => scale
.MajorUnit(1)
.MinorUnit(0.5)
.Max(4)
.Vertical(
false
)
.Ranges(ranges =>
{
ranges.Add().From(0).To(1).Color(
"#dbe5f1"
);
ranges.Add().From(1).To(2).Color(
"#cadbf0"
);
ranges.Add().From(2).To(3).Color(
"#b2c9e5"
);
ranges.Add().From(3).To(4).Color(
"#94b6df"
);
})
)
)
.Labels(x=>x
.Template(
"#= 't' #"
)
)
.Labels(x=>x
.Template(
"# 'function(r){ return 't'} #"
)
)
Uncaught Error: Invalid template:'# 'function(r){ return 't'} #' Generated code:'var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;with(data){$kendoOutput=''; 'function(r){ return 't'} ;$kendoOutput+='';}return $kendoOutput;'
.Labels(x=>x
.Template("#= 'function(r){ return 't'} #")
)
Uncaught Error: Invalid template:'#= 'function(r){ return 't'} #' Generated code:'var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;with(data){$kendoOutput=''+( 'function(r){ return 't'} )+'';}return $kendoOutput;'
@model
int
@(Html.Kendo().ComboBox()
.Name(
"ContactID"
)
.HtmlAttributes(
new
{ style =
"width:300px"
})
.AutoBind(
false
)
.Placeholder(
"Escriu..."
)
.DataTextField(
"Nom"
)
.DataValueField(
"ContactID"
)
.Filter(FilterType.Contains)
.MinLength(4)
.DataSource(source =>
{
source.Read(read => read.Action(
"SearchProductors"
,
"Productors"
,
new
{ area =
"Comercial"
}).Data(
"filterProductors"
))
.ServerFiltering(
true
);
})
//.HeaderTemplateId("ProductorSearch_HeaderTemplate")
.TemplateId(
"ProductorSearch_ItemTemplate"
)
)
<script id=
"ProductorSearch_HeaderTemplate"
type=
"text/x-kendo-tmpl"
>
<div>
<span
class
=
"k-widget k-header"
>Productor</span>
<span
class
=
"k-widget k-header"
>Poblacio</span>
</div>
</script>
<script id=
"ProductorSearch_ItemTemplate"
type=
"text/x-kendo-tmpl"
>
<div style=
"width:300px"
>
@*<span
class
=
"k-state-default"
>#: data.Poblacio #</span>*@
<p><span
class
=
"k-state-default"
>#: data.Nom #</span><span
class
=
"k-state-default"
>#: data.Poblacio #</span></p>
</div>
</script>
public
class
CollectServiceViewModel
{
[DisplayName(
"Ordre"
)]
[HiddenInput(DisplayValue =
false
)]
[Required(ErrorMessage =
"El número d'ordre es obligatori."
)]
public
int
ServiceID {
get
;
set
; }
[DisplayName(
"Albarà"
)]
public
string
RefExt {
get
;
set
; }
[DisplayName(
"Full Seguiment"
)]
public
string
DocNum {
get
;
set
; }
[DisplayName(
"Data Comanda"
)]
//[DisplayFormat(DataFormatString = "{0:d}")]
[DataType(DataType.Date)]
public
DateTime DataOrdre {
get
;
set
; }
[DisplayName(
"Data Servei"
)]
[DataType(DataType.Date)]
[UIHint(
"CustomDate"
)]
public
Nullable<DateTime> DataServei {
get
;
set
; }
[DisplayName(
"Expedició"
)]
[UIHint(
"ExpeditionsByData"
)]
public
Nullable<
int
> ExpeditionID {
get
;
set
; }
//public Nullable<short> Position { get; set; }
[DisplayName(
"Urgent"
)]
public
bool
Urgent {
get
;
set
; }
[DisplayName(
"Reclamat"
)]
[DataType(DataType.Date)]
public
Nullable<DateTime> DataClaim {
get
;
set
; }
[DisplayName(
"Recollida Extra"
)]
public
bool
Extra {
get
;
set
; }
[DisplayName(
"Productor"
)]
[Required(ErrorMessage =
"El productor es obligatori."
)]
[UIHint(
"ProductorSearch"
)]
public
int
ContactID {
get
;
set
; }
[DisplayName(
"Productor"
)]
[HiddenInput(DisplayValue =
false
)]
public
string
ProductorName {
get
;
set
; }
@(Html.Kendo().Grid<CollectServiceViewModel>()
.Name(
"collects"
)
.HtmlAttributes(
new
{ style =
"height: 100%; border: 0;"
})
.Scrollable()
.ToolBar(t =>
{
if
(User.IsInRole(
"Modify"
))
{
t.Create().Text(
"Nou Servei"
);
}
})
.Columns(columns =>
{
columns.Bound(f => f.ServiceID).Width(80);
columns.Bound(f => f.DataServei).Width(110);
columns.Bound(f => f.RefExt).Width(110);
columns.Bound(f => f.DocNum).Width(110);
columns.Bound(f => f.ProductorName).Width(300).Filterable(f => f.Operators(g => g.ForString(h => { h.Clear(); h.Contains(
"Conté"
); })));
columns.Bound(f => f.ContactID).Title(
"Codi"
).Width(80);
@(Html.Kendo().MobileView()
.Title("Site Verification")
.Name("outage-details-view")
.Content(@<
text
>
@using (Ajax.BeginForm("OutageDetails", "Outage", new AjaxOptions
{
HttpMethod = "POST"
}))
{
@Html.ValidationSummary(true);
@Html.AntiForgeryToken()
<
div
class
=
"form-group"
>
@Html.LabelFor(model => model.MeterNumber)
@Html.TextBoxFor(model => model.MeterNumber, new { @type = "number", @class = "form-control", placeholder = "Meter Number" })
</
div
>
<
div
class
=
"form-group"
>
<
label
>OR</
label
>
</
div
>
<
div
class
=
"form-group"
>
@Html.LabelFor(model => model.SiteId)
@Html.TextBoxFor(model => model.SiteId, new { @class = "form-control", @type = "number", placeholder = "Site ID" })
</
div
>
<
input
type
=
"submit"
value
=
"Next"
/>
}
</
text
>)
)
@{ Html.Kendo().Grid<
Vectra.CPN.CPNLibrary.ViewModel.TRANSFER_IN_V
>()
.Name("MainGrid")
.ToolBar(toolBar => toolBar.Template(@<
text
>
<
input
class
=
"t-button"
type
=
"button"
id
=
"ShowCreateNewExtFormId"
name
=
"ShowCreateNewExtForm"
value
=
"@Resources.Create"
onclick
=
"location.assign('@Url.Content("
~/" + ControllerName + "/New")')"/>
<
input
class
=
"t-button"
type
=
"button"
id
=
"ShowEditFormId"
name
=
"ShowEditForm"
value
=
"@Resources.Edit"
/>
<
input
class
=
"t-button"
type
=
"button"
id
=
"ShowDetailFormId"
name
=
"ShowDetailForm"
value
=
"@Resources.Details"
/>
<
a
class
=
"k-button k-button-icontext k-grid-excel"
href
=
"#"
><
span
class
=
"k-icon k-i-excel"
></
span
>Zapisz do Excela</
a
>
<
a
href
=
""
class
=
"k-button"
id
=
"save"
>Save View</
a
>
<
a
href
=
""
class
=
"k-button"
id
=
"load"
>Restore View</
a
>
</
text
>)
)
.Excel(ex => ex.AllPages(true).FileName("cpn_do_vectry_" + DateTime.Now.ToShortDateString() + ".xlsx"))
.ColumnMenu(column => column.Columns(true))
.Columns(columns => columns.LoadSettings((IEnumerable<
GridColumnSettings
>)ViewBag.GridColumns))
.Reorderable(reorder => reorder.Columns(true))
.Sortable(sortable => sortable.Enabled(true).SortMode(GridSortMode.SingleColumn).AllowUnsort(true))
.Pageable(pageable => pageable.Enabled(true).Refresh(true).ButtonCount(5).PageSizes(true).PageSizes(new int[] { 5, 10, 20, 50 }))
.Filterable(filtering => filtering.Enabled(true))
.Selectable(s => s.Mode(Kendo.Mvc.UI.GridSelectionMode.Single).Type(GridSelectionType.Row))
.Events(events => events.Change("onChange"))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("TransferIn_Read", "TransferIn"))
.Model(model => model.Id(o => o.TRANSFER_ID))
.ServerOperation(false)
)
.AutoBind(false)
.Render()
;
}
var
localStorageKey =
"MainTransferInOptions"
;
var
areOptionsLoaded =
false
;
function
bindSaveRestoreCliks()
{
var
grid = $(
"#MainGrid"
).data(
"kendoGrid"
);
$(
"#save"
).click(
function
(e) {
e.preventDefault();
localStorage[localStorageKey] = kendo.stringify(grid.getOptions());
});
$(
"#load"
).click(
function
(e) {
e.preventDefault();
loadGridOptions(e);
});
}
function
loadGridOptions(e)
{
if
(e == undefined || e.type ==
"click"
|| (!areOptionsLoaded && e.type ==
"read"
))
{
var
rawGrid = $(
"#MainGrid"
);
var
grid = $(
"#MainGrid"
).data(
"kendoGrid"
);
var
options = localStorage[localStorageKey];
var
toolbar = $(
"#MainGrid"
).find(
".k-grid-toolbar"
).html();
if
(options) {
grid.setOptions(JSON.parse(options));
}
else
if
(!areOptionsLoaded && e == undefined)
{
grid.dataSource.read();
}
var
newtoolbar = $(
"#MainGrid"
).find(
".k-grid-toolbar"
);
$(
"#MainGrid"
).find(
".k-grid-toolbar"
).html(toolbar);
bindSaveRestoreCliks();
areOptionsLoaded =
true
;
}
}
$(window).ready(
function
(e) {
loadGridOptions(undefined);
}
);
<
div
class
=
"col-md-3"
style
=
"vertical-align:middle"
>
@Html.LabelFor(m => m.DateFrom, new { @style = "width:100px" })
@(Html.Kendo().DatePickerFor(m => m.DateFrom)
.Format("{0:yyyy/MM/dd}")
.ParseFormats(new String[] { "MM/dd/yyyy hh:mm:ss" })
)
</
div
>
<
div
class
=
"col-md-3"
style
=
"vertical-align:middle"
>
@Html.LabelFor(m => m.DateTo, new { @style = "width:75px" })
@(Html.Kendo().DatePickerFor(m => m.DateTo)
.Format("{0:yyyy/MM/dd}")
.ParseFormats(new String[] { "MM/dd/yyyy hh:mm:ss" })
)
</
div
>
[Required]
[DataType(DataType.Date)]
[Display(Name =
"Date from"
)]
public
DateTime DateFrom {
get
;
set
; }
[Required]
[DataType(DataType.Date)]
[Display(Name =
"Date to"
)]
public
DateTime DateTo {
get
;
set
; }
<
input
aria-readonly
=
"false"
aria-disabled
=
"false"
aria-owns
=
"DateFrom_dateview"
aria-expanded
=
"false"
role
=
"combobox"
class
=
"k-input"
style
=
"width: 100%;"
data-role
=
"datepicker"
data-val
=
"true"
data-val-date
=
"The field Date from must be a date."
data-val-required
=
"The Date from field is required."
id
=
"DateFrom"
name
=
"DateFrom"
value
=
"02/23/2015 00:00:00"
type
=
"text"
>
jQuery(function(){jQuery("#DateFrom").kendoDatePicker({"format":"yyyy/MM/dd","parseFormats":["yyyy/MM/dd","yyyy.MM.dd","MM/dd/yyyy hh:mm:ss"],"min":new Date(1900,0,1,0,0,0,0),"max":new Date(2099,11,31,0,0,0,0)});});
<
input
aria-readonly
=
"false"
aria-disabled
=
"false"
aria-owns
=
"DateTo_dateview"
aria-expanded
=
"false"
role
=
"combobox"
class
=
"k-input"
style
=
"width: 100%;"
data-role
=
"datepicker"
data-val
=
"true"
data-val-date
=
"The field Date to must be a date."
data-val-required
=
"The Date to field is required."
id
=
"DateTo"
name
=
"DateTo"
value
=
"03/04/2015 23:59:00"
type
=
"text"
>
jQuery(function(){jQuery("#DateTo").kendoDatePicker({"format":"yyyy/MM/dd","parseFormats":["yyyy/MM/dd","yyyy.MM.dd","MM/dd/yyyy hh:mm:ss"],"min":new Date(1900,0,1,0,0,0,0),"max":new Date(2099,11,31,0,0,0,0)});});