Question

I got stuck in a problem with kendo datasource. I created the datasource array , because i have multiple grid to bind . The way i access the datasource is

ds[1] . ds[0],

When i execute ds[1].read(); it works fine and get the data from server.

As soon as i add a record into ds[1].add( json data) and try to read the datasource it give error undefined;

     dsSupplier[ActivetabRank].read();
$.each(tempArray.OrderDetailModel, function (key, value) {
dsSupplier[ActivetabRank].add({
"ParkOrderId": 0,
"itemDesc": value.ItemDesc,
"itemQty": 0,
"Supplier": {
"SupplierID": tempArray.SupplierModel.SupplierID,
tempArray.SupplierModel.EFax, "IsActive": true,
},
});
});

}); 
Was it helpful?

Solution

You didn't include definition of your datasource, so I will try to guess: Make sure you defined id in your model. I would suggest to follow quite strait forward example from the kendo doc. The fact datasources are in an array does not effect any functionality.

 schema: {
    model: { id: "ProductID" }
  }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top