Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Can't use a cell instance as a Column's 'cell' attribute #663

Open
n0nick opened this issue Jan 12, 2017 · 0 comments
Open

Can't use a cell instance as a Column's 'cell' attribute #663

n0nick opened this issue Jan 12, 2017 · 0 comments

Comments

@n0nick
Copy link

n0nick commented Jan 12, 2017

Although the Column documentation says about the cell attribute:

If this is a string, the capitalized form will be used to look up a cell class in Backbone, i.e.: string => StringCell. If a Cell subclass is supplied, it is initialized with a hash of parameters. If a Cell instance is supplied, it is used directly.

I can't get it to work when setting cell to be an instance of a Cell class, and indeed the failing line in the makeCell implementation seems to always want to call new on the given cell value:

  makeCell: function (column) {
    return new (column.get("cell"))({
      column: column,
      model: this.model
    });
  },

https://github.com/cloudflare/backgrid/blob/0.3.7/src/row.js#L77-L82

Am I missing something?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant