ng admin - Use reference field type on nested object id -


i'm experimenting ng-admin. have restful api, either has no related objects or embedded objects (manytoone onetomany). means use nested elements , embedded_list lot. works listview , showview. however, when want create or edit entities, need use 'reference' field type reference other related object. things go wrong. since objects embedded, identifier of referencing object nested, need example:

var addresstype = nga.entity('address-types')     .identifier(nga.field('name'));  var address = nga.entity('addresses'); address.listview()     .perpage(20)     .listactions(['show', 'edit', 'delete'])     .batchactions([])     .fields(         nga.field('addresstype.name', 'reference')             .label('type referenced')             .targetentity(addresstype)             .targetfield(nga.field('description'))             .cssclasses('col-sm-2')     ]); 

the above example works in showview , editview, not in listview. if create or edit new address view works fine. however, address object in situation edited , created person object, address embedded_list:

person.editionview().fields([     nga.field('id')         .detaillinkroute('show')         .editable(false),     nga.field('addresses', 'embedded_list')         .targetentity(address)         .targetfields(address.listview().fields()), 

if edit person can edit/add addresses, reference fields address not working, not working in listview.

any ideas on how can make scenario work?

thanks!


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -