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

Serializing a DataSource

2 Answers 507 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Jesper
Top achievements
Rank 1
Jesper asked on 03 Jul 2012, 12:03 PM
I want to send the data from my datasource manually, using a jQuery-ajax call.

But Kendo throws an error when jQuery tries to serialize the data:

  1. Uncaught TypeError: Cannot read property 'field' of undefined kendo.all.min.js:9
    1. o.extend.wrapkendo.all.min.js:9
    2. jQuery.extend.param.addjquery-1.7.1.js:7601
    3. jQuery.extend.activejquery-1.7.1.js:7646
    4. jQuery.extend.eachjquery-1.7.1.js:658
    5. jQuery.extend.paramjquery-1.7.1.js:7621
    6. jQuery.extend.ajaxjquery-1.7.1.js:7467
    7. (anonymous function)fiddle.jshell.net:58
    8. jQuery.event.dispatchjquery-1.7.1.js:3256
    9. jQuery.event.add.elemData.handle.eventHandlejquery-1.7.1.js:2875

I recreated the problem in this JsFiddle

Is there a better way of serializing the data from a Kendo data source?

2 Answers, 1 is accepted

Sort by
0
Ali
Top achievements
Rank 1
answered on 22 Oct 2012, 07:32 PM
Hello,

I know this is few months old, but just in case you still need it or someone elses needs it.

To serialize:
serialized = JSON.stringify(dataSource.data());

So in your case as per the code you submitted, you have to change the ajax data post to the serialized object I posted above.
0
Navin
Top achievements
Rank 1
answered on 10 Aug 2014, 05:15 PM
What is your controller signature? 
Tags
Data Source
Asked by
Jesper
Top achievements
Rank 1
Answers by
Ali
Top achievements
Rank 1
Navin
Top achievements
Rank 1
Share this question
or