I've banged my head off the table for too long and now I'm asking for help :) Here is my code:
All the kendo requirement files are of course included higher up in the page.
HTML:
And here is the javascript.
The update is successful every time, but the row I am updating just goes completely blank when I click the update button.
Any help is greatly appreciated!!
Kevin
All the kendo requirement files are of course included higher up in the page.
HTML:
<
strong
>ALIAS INFORMATION</
strong
><
br
/>
<
br
/>
<
form
id
=
"offenderAliasForm"
>
<
div
id
=
"grdAliases"
></
div
>
</
form
>
<
script
src
=
"/sdsoia/Scripts/OffenderFunctions/OffenderAliases.js"
></
script
>
<
script
type
=
"text/javascript"
>
$(function () {
initializeAliasForm();
});
</
script
>
And here is the javascript.
var
crudBaseUrl =
"/sdsoia/Services/Aliases.asmx"
;
var
currentOffenderId = $.cookie(
"CurrentPendingOffenderId"
);
var
readData =
"{ pendingOffenderId: "
+ currentOffenderId +
" }"
;
var
aliasDataSource =
new
kendo.data.DataSource({
transport: {
read: {
url: crudBaseUrl +
"/GetAliasesForPendingOffender"
,
dataType:
"json"
,
contentType:
"application/json"
,
type:
"POST"
,
dataFilter:
function
(data) {
var
msg = eval(
'('
+ data +
')'
);
return
msg.d;
}
},
update: {
url: crudBaseUrl +
"/UpdateAliasesForPendingOffender"
,
dataType:
"json"
,
contentType:
"application/json"
,
type:
"POST"
},
parameterMap:
function
(data, type) {
console.log(
"Using datasource for:"
, type,
"; data:"
, data);
switch
(type) {
case
"read"
:
data = {
pendingOffenderId: currentOffenderId
}
break
;
case
"update"
:
break
;
}
return
kendo.stringify(data);
}
},
schema: {
model: {
id:
"Id"
,
fields: {
Id: { editable:
false
},
OffenderId: { editable:
false
},
Name: {},
Ssn: {},
Dob: { type:
"date"
},
Timestamp: { editable:
false
}
}
}
}
});
var
grdAliases = $(
"#grdAliases"
).kendoGrid({
columns: [
{
field:
"Id"
,
hidden:
true
},
{
field:
"OffenderId"
,
hidden:
true
},
{
field:
"Name"
,
title:
"Name (Last, First, Middle)"
},
{
field:
"Ssn"
,
title:
"SSN"
,
format:
"{0: ###-##-####}"
,
editor:
function
(container, options) {
$(
"<input name='"
+ options.field +
"' />"
)
.appendTo(container)
.kendoMaskedTextBox({
mask:
"###-##-####"
});
}
},
{
field:
"Dob"
,
title:
"DOB"
,
type:
"date"
,
format:
"{0:d}"
},
{
field:
"Timestamp"
,
hidden:
true
},
{
command: [
{
name:
"edit"
,
text: { edit:
"Edit"
, cancel:
"Cancel"
, update:
"Update"
}
},
{
name:
"destroy"
,
text:
"Delete"
}
]
}
],
editable: {
mode:
"inline"
},
selectable:
true
,
dataSource: aliasDataSource,
toolbar: [
"create"
],
pageable: {
info:
true
,
refresh:
false
,
pageSizes:
false
,
previousNext:
false
,
numeric:
false
,
input:
false
,
messages: {
display:
"{2} records."
,
empty:
"No records found."
}
},
}).data(
"kendoGrid"
);
function
initializeAliasForm() {
}
The update is successful every time, but the row I am updating just goes completely blank when I click the update button.
Any help is greatly appreciated!!
Kevin