3

I make use of the sonata_type_collection for order rows inside my order. As soon as I create a new order I can click a button to add an order row.

Is it possible to change it to automatically show 5 rows on page load instead of clicking the button for the first row and so on?

I guess it is possible to make a JavaScript script for on page load to 'click' the Add New row button 5 times.

Jack Coolen
  • 229
  • 1
  • 13
  • 2
    No there is no default setting to show 5 times or other no., you have to pass manually data to this field then it will show no. of rows you have passed – M Khalid Junaid Aug 13 '16 at 10:20

1 Answers1

0

Well you have several options how to accomplish this.

  1. Override create or update method in CRUDController and if order does not have rows just create them and add to Order, they will be rendered.

  2. In method getOrderRows you can return 5new rows if non exits.

  3. If you first persit order you can also add rows in prePersist method in admin

zajca
  • 2,288
  • 4
  • 30
  • 40