adopted-ember-addons / adopted-ember-addons/ember-light-table

Set cell rowspan based on row value

Open
#597 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
311
Forks
130
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/offirgolan/ember-light-table/issues/243#issuecomment-373043700)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.