Hi, i have problem with create and update data, if i creating data and after that updating data, model/form create data is before will be running again, so data always added when update data.
this my script :
i think a solution is function parameterMap, but i don't know for using that
thank you before
this my script :
dataSource =
new
kendo.data.DataSource({
transport: {
read: {url:
"<?=base_url()?>/bank"
},
update: {url:
"<?=base_url()?>/bank/update"
, type:
"POST"
},
destroy: {url:
"<?=base_url()?>/bank/destroy"
,type:
"POST"
},
create: {url:
"<?=base_url()?>/bank/create"
,type:
"POST"
},
},
error:
function
(e) {
alert(e.responseText);
},
batch:
true
, pageSize: 25,
schema: {
model: {
id:
"id_bank"
,
fields: {
nama_bank: { type:
"string"
},
}
}
}
});
//kendo grid
$(
"#grid_bank"
).kendoGrid({
dataSource: dataSource,
editable:
"popup"
, height: 450, filterable:
true
, sortable:
true
, pageable:
true
,
toolbar: [
"create"
],
columns: [
{ field:
"nama_bank"
,title:
"Nama"
, filterable:
true
},
{ command: [
"edit"
,
"destroy"
], title:
" "
, width:
"160px"
}
]
});
i think a solution is function parameterMap, but i don't know for using that
thank you before