or
function
moveTo(from, to) {
for
(
var
i
in
checkedIds) {
var
isFound = to.dataSource.get(checkedIds[i]);
if
(checkedIds[i] !=
""
) {
if
(isFound == undefined) {
// Set 'From' Datasource to the correct page
var
ItemIdx = i % from.dataSource.pageSize();
var
PageNb = ((i - (ItemIdx)) / from.dataSource.pageSize()) + 1;
//alert("Item: " + ItemIdx + " Page: " + PageNb);
from.dataSource.page(PageNb);
var
view = from.dataSource.view();
var
item = view[ItemIdx];
to.dataSource.add(item);
}
}
}
}
01.
using System;
02.
using System.Collections.Generic;
03.
using System.Linq;
04.
using System.Web;
05.
using Airbus.Asam.Contracts;
06.
using Airbus.Asam.BusinessObjects;
07.
08.
namespace Customer.Asam.Presentation.Supplier.ViewModels
09.
{
10.
public class TempPP
11.
{
12.
public Boolean isInDB { get; set; }
13.
public string ID { get; set; }
14.
public string PPSRCAPPLICATION { get; set; }
15.
public string PPREF { get; set; }
16.
public string PPSITE { get; set; }
17.
public string DESCRIPTION { get; set; }
18.
public System.DateTime DATEFROM { get; set; }
19.
public System.DateTime DATETO { get; set; }
20.
public string PPLEVEL { get; set; }
21.
public Nullable<
decimal
> QUOTA { get; set; }
22.
}
23.
}
@model Customer.Asam.Presentation.Supplier.ViewModels.ARRViewmodel
@using Customer.Asam.Resources
@using Customer.Asam.Presentation.Supplier.Common
@using (Html.BeginForm("Create_Step3", "", FormMethod.Get, new { @id = "FORM_ARR_3" }))
{
<
div
>
<
h2
>@Asam_Strings.TITLE_CREATE_ARR_STEP 3 @Asam_Strings.TITLE_CREATE_ARR_PREVENTION_PLAN</
h2
>
@Asam_Strings.LABEL_PP_REFERENCE
@(Html.Kendo().DropDownList()
.HtmlAttributes(new { style = "width: 250px" })
.BindTo(Model.tempPP)
.Name("tempPP") //The name of the combobox is mandatory. It specifies the "id" attribute of the widget.
.DataTextField("PPREF") //Specifies which property of the Product to be used by the combobox as a text.
.DataValueField("ID") //Specifies which property of the Product to be used by the combobox as a value.
.Events(e => e
.Select(@<
text
>
function(e) {
e.preventDefault();
var dataItem = this.dataItem(e.item.index());
if (e.item.index() > 0)
{
var grid = $("#RefPP").data("kendoGrid");
grid.dataSource.add(dataItem);
}
} </
text
>))
)
<
script
>
function indexPP(dataItem) {
var data = $("#RefPP").data("kendoGrid").dataSource.data();
return data.indexOf(dataItem);
}
</
script
>
@(Html.Kendo().Grid(Model.RefPP)
.Name("RefPP")
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(1)
.ServerOperation(false)
)
.Columns(column =>
{
column.Bound(c => c.PPREF)
.ClientTemplate("#= PPREF # " +
"<
input
type
=
'hidden'
name
=
'RefPP[#= indexPP(data)#].PPREF'
value
=
'#= PPREF #'
/>" +
"<
input
type
=
'hidden'
name
=
'RefPP[#= indexPP(data)#].PPSRCAPPLICATION'
value
=
'#= PPSRCAPPLICATION #'
/>" +
"<
input
type
=
'hidden'
name
=
'RefPP[#= indexPP(data)#].PPSITE'
value
=
'#= PPSITE #'
/>" +
"<
input
type
=
'hidden'
name
=
'RefPP[#= indexPP(data)#].DESCRIPTION'
value
=
'#= DESCRIPTION #'
/>" +
"<
input
type
=
'hidden'
name
=
'RefPP[#= indexPP(data)#].DATEFROM'
value
=
'#= DATEFROM #'
/>" +
"<
input
type
=
'hidden'
name
=
'RefPP[#= indexPP(data)#].DATEFROM'
value
=
'#= DATEFROM #'
/>" +
"<
input
type
=
'hidden'
name
=
'RefPP[#= indexPP(data)#].DATETO'
value
=
'#= DATETO #'
/>" +
"<
input
type
=
'hidden'
name
=
'RefPP[#= indexPP(data)#].QUOTA'
value
=
'#= QUOTA #'
/>");
column.Bound(c => c.PPSITE);
column.Bound(c => c.DESCRIPTION);
column.Bound(c => c.DATEFROM)
.Format("{0:dd/MM/yyyy}");
column.Bound(c => c.DATETO)
.Format("{0:dd/MM/yyyy}");
column.Bound(c => c.QUOTA);
}
)
)
</
div
>
}