0

I am unable to figure out why my Kendogrid Transport's read doesn't invoke ajax call when I call Kendogrid's render(). All the functions are invoked except read() of Transport. I guess some third eye is required to point out mistake in my code. Please let me know if more information is needed. Spent a day on this and couldn't.

Here is my Transport and GridView

var Transport = KendoGridView.Transport.extend({

            read: function(options) {
                $.ajax({
                    url: this._grid.url+ '?' + $.param(_.extend({},
                        this._parameterMap(options.data)
                    )),
                    type: 'POST',
                    contentType: 'application/json',
                    data: JSON.stringify(myVariable),
                    success: function(response) {
                        options.success(response);
                    }
                });
            }
    });

    var MyGridView = KendoGridView.extend({
        _url : "abc/def/ghi",
        _model: MyModel, //My Backbone model
        _currentPage: 1,
        _transportCls: Transport

        initialize: function(options) {
            KendoGridView.prototype.initialize.apply(this, arguments);
        },

        render: function{
            KendoGridView.prototype.render.call(this);
        },

        _dataSourceConfig: function() {
            var config = KendoGridView.prototype._dataSourceConfig.call(this);
            return _.extend(config, {page: this._currentPage});
        },
    });

    return MyGridView;

I did similar way for other grids in my application. All other stuff is defined using require.js. Am I missing something ?

ashy143
  • 169
  • 11

1 Answers1

0

Figured it out. In my parent view inside render function, there is a line which renders grid inside a div.

render: function() {
    this.$el.html(template);
    this._myGridView.setElement(this.$("#myVariantDB- select-configured-grid")).render();

    return this;
}

Found that there was no div with id "#myVariantDB- select-configured-grid" Thought expected an error when div is not available.

ashy143
  • 169
  • 11