or
$(
"#cmbCompany"
).width(350).kendoComboBox({
placeholder:
"Select company"
,
serverFiltering:
true
,
dataTextField:
"Company"
,
dataValueField:
"ClientNo"
,
dataSource: {
transport: {
read:
"/Admin/GetAllCompany"
}
},
change:
function
() {
var
value =
this
.value();
if
(value) {
employeeDataSource.query({ companyNo: value });
employee.enable();
}
else
{
employee.enable(
false
);
}
employee.value(
""
);
}
});
var
employeeDataSource =
new
kendo.data.DataSource({
transport: {
dataType:
"json"
,
read:
"/Admin/GetEmployeesByCompany"
}
});
var
employee = $(
"#cmbEmployee"
).width(300).kendoComboBox({
autoBind:
false
,
placeholder:
"Select employee"
,
dataTextField:
"Name"
,
dataValueField:
"Email"
,
dataSource: employeeDataSource
}).data(
"kendoComboBox"
);
columns: [
{ field: "FirstName", title: "productos", format: "{0:c}", type:"String",editable: false, width: "150px" },
{ field: "City", title: "cantidad", editable:true, type:"Number", validation: { min: 1, required: true },width: "150px" },
{field: "BirthDate", title: "fecha de Entrega",type:"String",editable:true,width:"150px"},
{ field: "favoritos", title: "favoritos", editable:true, type:"String",width: "150px" },
{field: "boton", template: "#= '<
form
id=\"form3\" method=\"post\" action=\"prueba9.asp\"><
input
type=\"text\" name=\"nombre\"id=\"<-------------------here\"><
input
type=\"text\" name=\"apellido\" id=\"<------------------here\"><
input
type=\"button\" id=\"boton3\"class=\"boton3\"value=\"Enviar\" onclick=\"
document.form3.nomb.value
=documen t.form3.nomb.value;
document.form3.favo.value
=document.form3.favo.value;submit();\"></
form
>' #", title: "favorito", width: "100px",type:"String", editable:false },
{ field: "añadir", template: "#= '<
input
type
=
IMAGE
SRC=\"add.gif\"\id=\"añadir\" value=\"CODE\" />' #", title: "añadir", width: "210px",type:"String", editable:false }],
<
div
data-role
=
"rangeslider"
data-bind
=
"value: Capacity, events: {change: editCapacity}"
data-max
=
"20"
>
<
input
/>
<
input
/>
</
div
>
//From the model
editCapacity:
function
(site) {
saveCapacity(site);
}
function
saveCapacity(site){
var
data =
{
"id"
: viewModel.BlockID ,
"campusid"
: viewModel.selectedCampus.get(
"CampusID"
),
"rotationid"
: viewModel.selectedRotation.get(
"RotationID"
),
"siteid"
: site.data.get(
"SiteID"
),
"min"
: site.data.get(
"Capacity"
)[0],
"max"
: site.data.get(
"Capacity"
)[1]
};
$.ajax({
url:
"/api/cps/clerkship/blocks/"
+ viewModel.BlockID +
"/editcapacity"
,
type:
"PUT"
,
data: data,
}).done(
function
() {
});
}
viewModel = kendo.observable({
selectedItem:
null
,
editItem:
function
(item) {
selectedItem = item;
}
});