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

2 posts, 0 answers
  1. Dirk
    Dirk avatar
    3 posts
    Member since:
    Sep 2012

    Posted 27 Sep 2012 Link to this post

    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)
  2. Rosen
    Admin
    Rosen avatar
    3253 posts

    Posted 28 Sep 2012 Link to this post

    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!
Back to Top