0

I yuse the smart ng-admin javascript framework for my admin

I want to have some difference between edit and add view ..

for instance, i want to add some fields in edit view : I would like to do someting like that :

var addViewFields = recipe.creationView().fields([
       nga.field('title'),
       nga.field('guest')]);
var editViewFields = angular.copy(addViewFields);

and i would like to do something like that :

editViewFiels.push(nga.field('pictureUpload','file').etc ...)

Could you folks help with that ? Thanks in advance, have a nice day coding and doing some smart things.

user2626210
  • 115
  • 5
  • 13

1 Answers1

0

You can actually refer the the fields on another view with the syntax entity.viewName().fields(). So in your case it would be:

recipe.editionView.fields([
    recipe.creationView().fields(),
    nga.field('pictureUpload', 'file'),
    ...
])
cfatt10
  • 688
  • 1
  • 7
  • 13