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

Configuration for DataSourceTransport for update (PUT) against REST API

0 Answers 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 07 Oct 2013, 04:05 PM

I am trying to see how to configure the update transport when the remote script is a REST service

Via curl I can perform an update :

curl -X PUT -d "room=1&notes=test test&desc=18 to 25 years" http://myapisite.com/api/room/1

This works fine and updates the remote database.

But I cannot see an example of how to append the parameters via the update transport config; I get this error when attemping to send an edit :

  1. Uncaught TypeError: Cannot read property 'data' of undefined kendo.web.min.js:11
    1. ct.extend.setupkendo.web.min.js:11
    2. ct.extend.updatekendo.web.min.js:11
    3. (anonymous function)kendo.web.min.js:11
    4. b.extend.Deferredjquery-1.9.1.js:7541
    5. dt.extend._promisekendo.web.min.js:11
    6. dt.extend._sendkendo.web.min.js:11
    7. dt.extend.synckendo.web.min.js:11
    8. T.extend.saveRowkendo.web.min.js:18
    9. (anonymous function)kendo.web.min.js:18
    10. b.event.dispatchjquery-1.9.1.js:9593
    11. v.handle

I do see when I look @ the grid object while in developer tools that the dataSource data property for the grid is  undefined.   Which makes sense of the error above.  I guess my question is where to define/bind that data property ....

 

grid.options
Object {prefix: "", name: "Grid", columns: Array[4], toolbar: Array[1], autoBind: true}
  1. altRowTemplate: ""
  2. autoBind: true
  3. columnMenu: false
  4. columnResizeHandleWidth: 3
  5. columns: Array[4]
    1. 0: Object
      1. field: "room"
      2. title: "Room #"
      3. __proto__: Object
    2. 1: Object
    3. 2: Object
    4. 3: Object
    5. length: 4
    6. __proto__: Array[0]
  6. dataSource: Object
    1. data: undefined
    2. fields: Array[4]
      1. 0: Object
        1. encoded: true
        2. field: "room"
        3. title: "Room #"
        4. __proto__: Object
      2. 1: Object
      3. 2: Object
      4. 3: Object
      5. length: 4
      6. __proto__: Array[0]
    3. schema: Object
    4. table: T.fn.init[1]

No answers yet. Maybe you can help?

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