mydea / handsontable-chosen-editor

Use a chosen select field in a Handsontable.
http://mydea.github.io/handsontable-chosen-editor/
MIT License
63 stars 36 forks source link

Trying to use on cells function #13

Closed vmagalhaes closed 5 years ago

vmagalhaes commented 5 years ago

Hi,

I'm trying to use this plugin on cells functions, that way:

` cells: (row, col, prop) => { let cellMeta = {};

    if (row === 0) {
        // cellMeta.type = 'dropdown';
        // cellMeta.source = _.map(this.metalayerFields, (field) => field.alias);
        cellMeta = {
          renderer: this.customDropdownRenderer,
          editor: 'chosen',
          width: 150,
          chosenOptions: {
            data: _.map(this.metalayerFields, (field) => {
              return { id: field.id, label: field.alias };
            })
          }
        };
        cellMeta.className = 'first-row-blue';
    } else if (row === 1) {
      cellMeta.readOnly = true;
      cellMeta.className = 'second-row-grey';
    }

    return cellMeta;
  }`

But I'm having this error:

Uncaught Error: No editor registered under name "chosen"

Any help? Thanks.

mydea commented 5 years ago

Have you included all dependency scripts in your page?

vmagalhaes commented 5 years ago

@mydea

Yeh! Inside of angular.json

image

mydea commented 5 years ago

Hmm, not sure then. I don't actively use this package anymore, so to be honest this is pretty much in maintenance-only mode. Might be related to a newer handsontable version or something similar, maybe? I Also don't really know how the cells function works, I've only ever tested this with defining it in columns.

vmagalhaes commented 5 years ago

Ah ok, I will try in another way, thanks for you help :+1: