-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[1.0] dom-repeat observe non-array values #1683
Comments
If somebody else has the same issue, a workaround is to call
every time the filter property changes. This way dom-repeat will update. |
If the sort/filter depends on properties outside the This is covered in the API docs:
|
Thanks, |
@amannn How to call
??? |
You can do something like the following on your properties: {
filterRoom: {
type: String,
observer: '_filterRoomChanged'
}
},
_filterRoomChanged: function() {
this.$.resultList.render();
} |
@amannn The reference docs are up at http://polymer.github.io/polymer/. Change the dropdown to "dom-repeat". Arguably, these docs aren't very discoverable :( |
@amannn Thank you 👍 |
For some reason none of the above mentioned work-arounds do not work in my case. The only thing which works is this ugly hack: <template id="optionsList" is="dom-repeat" filter="{{buildFilter(filter)}}" sort="alpha" items="{{items}}">
(...)
refreshOptionsList: function () {
var items = this.items;
this.items = [];
var self = this;
this.async(function () {
self.items = items;
});
} |
@mazswojejzony your hack has one problem. If |
Yes, that may happen if you call Too bad it does not work out-of-the-box in 1.0. |
According to the documentation, the observe option for dom-repeat can only react to properties changing on an object in the array that is consumed by the dom-repeat. It would be great if observe can also react to properties from the custom element the dom-repeat lies within.
Let's say I have a dom-repeat that lists employees, I want to use a filter function that reacts to an input field above, by which the employees can be filtered. Now as far as I understand there is no way to tell the dom-repeat to re-render when the data-bound property from the input field changes.
The text was updated successfully, but these errors were encountered: