This is a migrated thread and some comments may be shown as answers.

how to reset model/form create data

0 Answers 189 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rooney
Top achievements
Rank 1
rooney asked on 17 Oct 2012, 06:10 PM
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 :
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

No answers yet. Maybe you can help?

Tags
Grid
Asked by
rooney
Top achievements
Rank 1
Share this question
or