Comments (8)
Hi @aexmachina, sorry you're facing so many issues. I think the documentation definitely needs a lot more work but in the mean time, ill try to answer your questions as best I can.
I've encountered several issues trying to use the cellComponent property on my column definition. The docs don't make it clear that the component path must be light-table/cells/my-component.
cellComponent
can be declared anywhere (see here) but a cellType must be declared in light-table/cells/
(see here)
If I provide a valuePath in the columns spec I get an error Cannot set read-only property "value" on object. The workaround is to define value: null on the Cell subclass, but the valuePath has no effect.
Not really sure what you are trying to do here. valuePath
should be a string with the path on the model to the value you want to display.
Also, the only way for me to get the value was from row.content.
Row is an ObjectProxy. To access content on it you just need to do row.get('someProp')
no need to use row.content unless you are attempting to call a function.
from ember-light-table.
cellComponent can be declared anywhere (see here) but a cellType must be declared in light-table/cells/ (see here)
Okay, cool thanks. So to be clear the difference between cellComponent
and cellType
is that cellType
is looked up in light-table/cells/
? FWIW, my feeling is that it adds complexity for little benefit. Also the fact that they have a different interface is perhaps confusing - cellType
is provided rawValue
and cellComponent
is provided value
.
Not really sure what you are trying to do here. valuePath should be a string with the path on the model to the value you want to display.
Here's what I'm providing:
new Table([{
label: 'Status',
valuePath: 'status',
cellComponent: 'subbie-pca-status',
}], data)
and I get Cannot assign to read only property 'stack' of object '[object Object]'
. If I define the Cell as follows then it does work:
Cell.extend({
value: null
})
In fact, even if I don't specify valuePath
this is still required.
Row is an ObjectProxy.
Okay cool.
from ember-light-table.
So to be clear the difference between cellComponent and cellType is that cellType is looked up in light-table/cells/?
cellType !== cellComponent. cellComponent is just the content of a tbody cell. You can find out more info about cellType here
I get Cannot assign to read only property 'stack' of object '[object Object]'
Im really sorry, but I dont have much context here. Can you post code snippets of the cellComponent, and your table component?
from ember-light-table.
Cool, got it.
Here's my code:
// app/pods/my-component/component.js
export default Component.extend({
table: computed(function() {
let columns = [{
label: 'Status',
valuePath: 'foo',
cellComponent: 'subbie-pca-status',
}]
return new Table(columns, [
{foo: 'bar'}
])
})
})
// app/pods/my-component/template.hbs
{{#light-table table classNames='table' as |t|}}
{{t.head
iconAscending='fa fa-sort-asc'
iconDescending='fa fa-sort-desc'}}
{{#t.body as |body|}}
{{#if table.isEmpty}}
{{#body.no-data}}
No matching subbies.
{{/body.no-data}}
{{/if}}
{{/t.body}}
{{/light-table}}
// app/pods/components/subbie-pca-status/component.js
import Cell from 'ember-light-table/components/cells/base';
export default Cell.extend({
value: null,
})
// app/pods/components/subbie-pca-status/template.hbs
row.foo: {{row.foo}}<br>
value: {{value}}
This all works, except if I remove value: null
on the Cell subclass it throws an error Cannot assign to read only property 'stack' of object '[object Object]'
from ember-light-table.
export default Cell.extend({
value: null,
})
Where is Cell
coming from?
from ember-light-table.
import Cell from 'ember-light-table/components/cells/base'
from ember-light-table.
import Cell from 'ember-light-table/components/cells/base'
The only place this should happen is for creating custom cell types and not for cellComponent. Just use Ember.Component.extend and it should fix your problem.
from ember-light-table.
Right okay thanks.
from ember-light-table.
Related Issues (20)
- Responsive table with Occlusion HOT 2
- It appears that ember-light-table is having lot of issues with ember-octane? are there any solutions for this that i should look into? has anyone else had these issues? HOT 8
- Ever expanding .tse-scroll-content height value... HOT 3
- Error: Assertion Failed: [ember-light-table] table must be an instance of Table. Ember 3.11 and above HOT 12
- Transferring to adopted-ember-addons HOT 9
- Selectors get hidden in the last row of a table
- Error: You attempted to overwrite the built-in helper βarrayβ. HOT 13
- Development Roadmap HOT 41
- [email protected] addon incompatibility in 2.0 beta HOT 2
- Ember 3.16 update breaking when table.setRows is called immediately after creating the table HOT 3
- Stop scrolling to top on model update HOT 1
- 404 http://offirgolan.github.io/ HOT 3
- 3.0.0-beta.0 Cannot update rowspan HOT 2
- Update test blueprints to new format HOT 2
- ELT 3.0.0-beta.0 incompatible with Ember 3.27+ HOT 2
- using older version and Getting TypeError: decorator is not a function HOT 1
- Dynamic responsiveness not working HOT 1
- Remove font awesome dependencies
- Deprecations HOT 1
- Ember light table breaks project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-light-table.