You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 2, 2019. It is now read-only.
In 0.38, when clicking a column header to sort I got this error:
backgrid.js:2489 Uncaught TypeError: Cannot read property 'row' of undefined
at backgrid.js:2489
solution
The issue appears to be in the method refresh which refers to this in a different scope. It's resolvable by keeping a reference to this in the method and referring to that inside the loop. The following method can be patched in:
Backgrid.Body.prototype.refresh=function(){for(vari=0;i<this.rows.length;i++){this.rows[i].remove();}varself=this;// NEWthis.rows=this.collection.map(function(model){varrow=newself.row({// CHANGE `this` TO `self`columns: self.columns,// CHANGE `this` TO `self`model: model});returnrow;},this);this._unshiftEmptyRowMayBe();this.render();this.collection.trigger("backgrid:refresh",this);returnthis;}```###