Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set cell rowspan based on row value #597

Open
fran-worley opened this issue Nov 2, 2018 · 1 comment
Open

Set cell rowspan based on row value #597

fran-worley opened this issue Nov 2, 2018 · 1 comment

Comments

@fran-worley
Copy link
Collaborator

I thought this would be relatively straight forward using a custom cell type:

import Cell from 'ember-light-table/components/cells/base';
import { computed, get } from '@ember/object';

export default Cell.extend({
  attributeBindings: ['rowspan'],
  rowspan: computed('row.content.expanded', 'row.subtaskCount', function() {
    if (get(this, 'row.expanded')) {
      return get(this, 'row.subtaskCount');
    }
  })
});

However what I find is that row properties are always either null or undefined no matter what I do! Am I missing something?

A followup point to this would be how to disable a cell rendering at all based on a value. Essentially, if my row is 'expanded', I want the first column to span the expanded rows and the expanded rows not to include the first column.

Note: I'm not using the standard implementation of expanded here in favour of something along these lines

@alexander-alvarez
Copy link
Collaborator

Hey @fran-worley sorry you're struggling with this.

A followup point to this would be how to disable a cell rendering at all based on a value. Essentially, if my row is 'expanded', I want the first column to span the expanded rows and the expanded rows not to include the first column.

It may be because I haven't had my ☕ but I'm not following this -- would it be possible to throw up a quick demo (or screenshots) that I can see to understand more clearly what you mean?

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

No branches or pull requests

2 participants