Editor: Create new rows from data in an existing row

Editor: Create new rows from data in an existing row

burncharburnchar Posts: 118Questions: 12Answers: 0
edited June 2012 in Editor
Can Editor allow new rows to be created, populated with an existing row?
e.g. a user wants to copy an existing row 10 times and change just one column in each newly copied row (because the other data is common), how can this be done?

Replies

  • allanallan Posts: 63,573Questions: 1Answers: 10,483 Site admin
    Rows created by Editor are currently done one at a time - unless you add an additional parameter to the Ajax request that will instruct the server to deal with the request differently. What you could do to create a new row based on an existing row is to either:

    1. Use the API from DataTables to get the values of each field and use Editor's 'set' method to set the value based on your template row. Then call 'submit' to submit the value.

    2. Similar to 1, but call 'edit' on a row with Editor and then use the 'get' method to get the value of each option (without showing the edit form visually) and use that information to populate a 'create' call which will be submitted to the server.

    Hope that helps!

    Regards,
    Allan
  • burncharburnchar Posts: 118Questions: 12Answers: 0
    Thank you for your assistance. I got my company to buy a license for me. It seems like we're getting a free Lexus (DataTables) but only paying for the gas cap (Editor), but I'm glad you have some commercial bits because I could never convince any employer to donate (though I donated a little bit).
This discussion has been closed.