Hi,
I encounter one issue while try to implement the grid to my project:
My current source:
01.
skillsGrid_DS =
new
kendo.data.DataSource({
02.
transport: {
03.
read: {
04.
url: skillsGrid_svc,
05.
dataType:
"json"
,
06.
beforeSend:
function
(xhr) {
07.
return
Core.RESTFulSettings(xhr, site.sessionToken);
08.
}
09.
},
10.
create: {
11.
url: skillsGrid_svc,
12.
dataType:
"json"
,
13.
type:
"POST"
,
14.
beforeSend:
function
(xhr) {
15.
return
Core.RESTFulSettings(xhr, site.sessionToken,
"POST"
);
16.
}
17.
},
18.
update: {
19.
url: skillsGrid_svc,
20.
dataType:
"json"
,
21.
type:
"POST"
,
22.
beforeSend:
function
(xhr) {
23.
return
Core.RESTFulSettings(xhr, site.sessionToken,
"POST"
);
24.
}
25.
},
26.
parameterMap:
function
(options, operation) {
27.
if
(operation !==
"read"
&& options.models) {
28.
return
kendo.stringify(postData);
29.
}
30.
}
31.
},
32.
serverPaging:
true
,
33.
batch:
true
,
34.
pageSize: 20,
35.
schema: {
36.
model: {
37.
fields: {
38.
SkillCode: { type:
"number"
, validation: { required:
true
} },
39.
Core: { type:
"boolean"
},
40.
YearOfExperienceCodeId: { type:
"number"
, validation: { required:
true
} }
41.
}
42.
}
43.
}
44.
});
45.
46.
$(
'#SkillsGrid'
).kendoGrid({
47.
dataSource: skillsGrid_DS,
48.
editable:
"inline"
,
49.
pageable:
true
,
50.
toolbar: [
"create"
,
"save"
,
"cancel"
],
51.
columns: [
52.
{field:
"ClassificationCode"
, editor: vm.editor_Classifications, validation: { required:
true
} },
53.
{field:
"ElementCode"
, editor: vm.editor_Elements, validation: { required:
true
} },
54.
{field:
"SkillRequired"
, title:
"Skill Required"
, editor: vm.editor_SkillResource, validation: { required:
true
} },
55.
{field:
"Core"
, width:
"75px"
, validation: { required:
true
}},
56.
{field:
"YearOfExperienceCodeId"
, width:
"150px"
, validation: { required:
true
}, editor: vm.editor_YrsExperience, title:
"Yrs of Experience"
},
57.
{title:
" "
, width:
"75px"
, command:
"destroy"
}
58.
]
59.
});
And the issues are:
- As soon as I click on "CREATE" button, the row I entered gone and replaced by a blank row
- I want to submit the batch in format below but the requested data is included all columns content
1.
[{
"SkillCode"
:
"1"
,
"Core"
:
"true"
,
"YearOfExperienceCodeId"
:
"4"
},
2.
{
"SkillCode"
:
"132"
,
"Core"
:
"false"
,
"YearOfExperienceCodeId"
:
"1"
}]
I'm looking a lot from the forum and cant find my answers. Could you please help me for more information about it.
Thank you and Best regards,