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

_pristine is undefined in an empty DataSource with schema.total specified

1 Answer 137 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Dirk
Top achievements
Rank 1
Dirk asked on 27 Sep 2012, 11:13 PM
This code:
var MyModel = kendo.data.Model.extend();
var MyDataSource = kendo.data.DataSource.extend({
    options: {
        transport: {
            create: {
                url:
'dummy.json',
                type:
'GET',
                dataType:
'json'
            },
            read: {
                url:
'dummy.json',
                type:
'GET',
                dataType:
'json'
            },
            update: {
                url:
'dummy.json',
                type:
'GET',
                dataType:
'json'
            },
            destroy: {
                url:
'dummy.json',
                type:
'GET',
                dataType:
'json'
            }
        },
        schema: {
            model: MyModel,
            data:
'data',
            total:
'total'
        }
    }
});

var myDataSource = new MyDataSource();
var myModel = new MyModel({
    ding: 'dong',
    ping: 'pong'
});

myDataSource.add(myModel);
myDataSource.sync();

Creates this error message:
  1. Uncaught TypeError: Cannot call method 'push' of undefined kendo.web.js:6109
    1. Observable.extend._acceptkendo.web.js:6109
    2. Observable.extend.synckendo.web.js:6067
    3. f.Callbacks.njquery.min.js:2
    4. f.Callbacks.o.fireWithjquery.min.js:2
    5. f.Callbacks.o.firejquery.min.js:2
    6. Observable.extend._promise.$.Deferred.transport.(anonymous function).call.extend.successkendo.web.js:6175
    7. f.Callbacks.njquery.min.js:2
    8. f.Callbacks.o.fireWithjquery.min.js:2
    9. f.support.ajax.f.ajaxTransport.send.djquery.min.js:4

If schema.total is not defined everything works fine.
Unfortunately we need the total because we use a pageable Grid.

Any help or thoughts on that issue?

An example can be found here: http://dl.dropbox.com/u/105042779/kendo/datasource.html (Please look into the source code or console)

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 28 Sep 2012, 07:32 AM
Hello Dirk,

The issue you have described should be already addressed. The fix is present in the Q2 2012 SP1 of KendoUI (which is available to our commercial license holders) and will be included in the Q3 2012 release. 

All the best,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Data Source
Asked by
Dirk
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or