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

Grid Transport method not working.

1 Answer 467 Views
Grid
This is a migrated thread and some comments may be shown as answers.
choi
Top achievements
Rank 1
choi asked on 23 Feb 2015, 02:17 AM
Hi. I'm troubling with updating data for grid.

I'm using angularjs with kendo.

This is my code...

var gridoption = {
   dataSource :{
     transport :{

        read : { 
                url : "grid/ajax/file1",
                dataType :'json",
        },
    
       update : function(e){
             console.log("I'm calling update!!");
       }
     }
   }
};





Grid called method 'read' properly, but when I edited the row, clicked the "update" button ,nothing happend.

So I changed my code like this.

var gridoption = {
   dataSource :{
     transport :{

        read : function(e){ 
                $http({
                      url : "grid/ajax/file1"
                }).success(data){
                         e.success(data);
               });
        },
    
       update : function(e){
             console.log("I'm calling update!!");
       }
     }
   }
};

Then I can load my data from "read" method and update the changed data properly.

Can't I use  both 'read : function(e){}' and 'read : { url :...}' in one trasport option?


 






1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 24 Feb 2015, 03:27 PM
Hi Choi,

The "update" operation is not called as the dataSource is missing the "schema.model.fields" / "schema.model.id" configuration which is mendatory for enabling create/update/destroy operations over the data. For more information you can check the dataSource API:
Also it's not supported to combine both functions and objects with settings for the CRUD operations in the transport. 

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
choi
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or