Comments (4)
Hi!
Not sure what you mean by "linking" the item and column together, but you should be able to bind the column
from dom-repeat
normally anywhere you like.
So in practice:
<data-table-column name="[[column.label]]">
<template>[[column.label]]</template>
</data-table-column>
But.. looking at your example I would guess that you're trying to access a property on the item
with a name of the column.label
right?
For that, I'd suggest having a function in the parent component which takes both item
and column.label
as parameters.
_itemValue: function(item, prop) {
return item[prop];
}
<data-table-column name="[[column.label]]">
<template>[[_itemValue(item, column.label)]]</template>
</data-table-column>
from iron-data-table.
Tx for the reply.
Yes, that is what i mean...and the solution is so obvious ;)
tx again ( also for iron-datatable)
from iron-data-table.
np!
from iron-data-table.
Sorry...haven't had time to actually try it out...
<iron-data-table items="[[records]]">
<template is="dom-repeat" items="[[origin.fields]]" as="column">
<data-table-column name="[[column.label]]">
<template>[[_itemValue(item,column.label)]]</template>
</data-table-column>
</template>
</iron-data-table>
_itemValue: function(record,prop) {
console.log(record,prop)
return record[prop]
},
now it seems that in <template>[[_itemValue(item,column.label)]]</template>
column.label is not accesible anymore. If i only send 'item' to the _itemValue
function it logs the item. If i only send column (or column.label) it doesn't do anything.
Note: The columns-names are rendered
A few hours later...
Nope: column is not available anymore inside the <data-table-column>
from iron-data-table.
Related Issues (20)
- Collapse/Expand item - accept item index HOT 1
- data-table-column align center request HOT 2
- Make it possible to control loading opacity with css
- Limit sort to one column at a time
- Integrating iron-data-table with any context-menu plugin.
- Table elements in hidden dom elements forever invisible HOT 4
- Event when a row loading is complete HOT 1
- way to refresh or re-render a particular row? HOT 1
- data fetched twice at initialization using dynamic size
- Roadmap for supporting iron-list methods for selection / scrolling? HOT 1
- Re-adding custom element with iron-data-table on the same parent HOT 1
- Reset table and change datasource
- Template-ize table rows HOT 3
- Filter input fields too long in IE HOT 3
- Different events for cell selection and checkbox selection HOT 2
- Maintainers needed HOT 12
- How to add a particular style for a row? HOT 1
- Programmatically setting sortOrder right after setting items array does not have any effect
- How to disable checkbox for individual rows?
- [[item]] not working dom-if
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 iron-data-table.