[view/slickgrid][xs]: set recline-slickgrid on view element so that we can pass element in to the view (neede for non-multiview usage e.g. in tutorial).
This commit is contained in:
@@ -11,6 +11,8 @@ this.recline.View = this.recline.View || {};
|
|||||||
// https://github.com/mleibman/SlickGrid
|
// https://github.com/mleibman/SlickGrid
|
||||||
//
|
//
|
||||||
// Initialize it with a `recline.Model.Dataset`.
|
// Initialize it with a `recline.Model.Dataset`.
|
||||||
|
//
|
||||||
|
// NB: you need an explicit height on the element for slickgrid to work
|
||||||
my.SlickGrid = Backbone.View.extend({
|
my.SlickGrid = Backbone.View.extend({
|
||||||
tagName: "div",
|
tagName: "div",
|
||||||
className: "recline-slickgrid",
|
className: "recline-slickgrid",
|
||||||
@@ -18,6 +20,7 @@ my.SlickGrid = Backbone.View.extend({
|
|||||||
initialize: function(modelEtc) {
|
initialize: function(modelEtc) {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.el = $(this.el);
|
this.el = $(this.el);
|
||||||
|
this.el.addClass('recline-slickgrid');
|
||||||
_.bindAll(this, 'render');
|
_.bindAll(this, 'render');
|
||||||
this.model.currentRecords.bind('add', this.render);
|
this.model.currentRecords.bind('add', this.render);
|
||||||
this.model.currentRecords.bind('reset', this.render);
|
this.model.currentRecords.bind('reset', this.render);
|
||||||
@@ -56,7 +59,6 @@ my.SlickGrid = Backbone.View.extend({
|
|||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.el = $(this.el);
|
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
enableCellNavigation: true,
|
enableCellNavigation: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user