ng-admin icon indicating copy to clipboard operation
ng-admin copied to clipboard

editionView won't work with reference_many

Open toblie opened this issue 7 years ago • 4 comments

I created a model with some reference_many fields. Here a sample of it:

nga.field('topics', 'reference_many')
        .targetEntity(topic)
        .targetField(nga.field('name'))
        .label('Themen')

On creationView all is working fine but in editionView it only shows the items with "remove icon" but without labels. bildschirmfoto 2017-06-29 um 14 07 34

And additional I got some errors on console... I dont know these requests and what they are for. Maybe the issue caused because of these errors. bildschirmfoto 2017-06-29 um 14 05 15

It would be nice to get a solution or at least a little hint to solve this. Thanks

toblie avatar Jun 29 '17 12:06 toblie

Hello,

Can you provide a Plunkr in order to help us ?

Thanks

Kmaschta avatar Jun 29 '17 13:06 Kmaschta

Thanks for your reply... but I think I can't because it is using my local REST API. so... you see the result above and my declaration of fields... maybe yo can identify any issue or missing declaration?

Thanks

toblie avatar Jun 29 '17 14:06 toblie

Is there anyone who can help and maybe show me a sample of working reference_many editionView ? Thanks

toblie avatar Jun 30 '17 10:06 toblie

I had the same problem, in my case the problem depended on type mismatch. The entity id was a numeric type but I tried to link this entity with a list of String instead of a list of number. This is a example: user: [ { id: '1', profil_pic:"http://www.free-icons-download.net/images/user-icon-44709.png", name: 'John', email: 'toto@admin', permissions: ["1","2","3"], // here the ids are string!!! } ]

permissions: { id: 1, //here the id is a number!!! name: 'ADMIN', gid: 1000 }

I don't know why it work on listView and showView but it doesn't work on editView.

Plunker link: https://next.plnkr.co/edit/POXOeJlnSxm9FRJq

danielesergio avatar Sep 27 '17 12:09 danielesergio