Nested dom-repeat not displaying the inner content

47 views
Skip to first unread message

david radley

unread,
Jul 19, 2019, 12:08:09 PM7/19/19
to Polymer
Hello,
I am a maintainer for an open source project Egeria and am looking to create a CRUD grid in Polymer. It appears that there are not free versions of this. I would be interested in what approach people recommend.

In the absense of a free sufficiently capable component, I am looking to see if I can create a grid component - I am a bit of newbie at Polymer.


I have an array of json objects pairs that I use as the data for a property pane. The json objects have a name, type and value. I successfully use a dom-repeat to display each json object as a property in a property pane - which the type dictating what sort of widget I use. 

I would like to use the same sort of idea to back a grid with an array of json objects with property name item and the valuer as the propertyArrays. 


I have a gridView as  (view item is {{item}} is debug coe to prove I have an item: it  displays as expected as  "view item is [object Object]". But the item passed to the property-row does not update the modelInstance property. The item is {{item}}  is never displayed. I cannot see what I am doing wrong. 

The grid component view has:

<form is="iron-form">
<dom-repeat items={{modelInstances}} mutable-data>
<template>
<p>
view item is {{item}}
<property-row modelInstance={{item}}> </property-row>
</p>
</template>
</dom-repeat>
</form>

then property-row component has 
<dom-repeat items="{{propertyArray}}" mutable-data>
<template>
item is {{item}}
</template>
</dom-repeat>

modelInstance: {
type: Object,
notify: true,
observer: '_handleModelInstanceChanged'
},
propertyArray: {
type: Array,
notify: true,
value: function() { return []; },
computed: '_computePropertyArray(modelInstance)'
},

_computePropertyArray(instance) {
return instance.item;
}


  
Many thanks, David, 





david radley

unread,
Jul 23, 2019, 3:44:35 AM7/23/19
to Polymer
I have raised 2 questions on stack overflow relating to what I am trying to achieve. I have tried to describe the exact issues I am seeing with code supplied to recreate https://stackoverflow.com/questions/57150174/polymer-array-mutations-are-not-reflected-into-child-component and https://stackoverflow.com/questions/57146636/polymer-mutabledata-mixin-only-honour-mutations-with-notifypath

Reply all
Reply to author
Forward
0 new messages