Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Save multiple Records from a TableField


Reply


603 Views

Avatar
cornJ

Community Member, 3 Posts

1 December 2010 at 4:30am

Edited: 01/12/2010 4:31am

Most probably a stupid question again:

I have a Form with a TableField in the CMS where a user can modify the values of a set of records at the same time. Now how do I (elegantly) save the changes back to the database?

My first attempt was to loop over the returned data, get every changed DataObject via its ID and save the changed data. This works... but there is a prettier way, isn't there?

Anyway if not, I still got one problem: The Form recognizes the changes setting the status to unsaved (in javascript). But it does not recognize the save action. Becaus the saveing is done with ajax i have to put some javascript into my answer telling the form to set the status back to saved, so the anoying "not saved warning" does not appear on leaving the page.

showMessage("Saved") shows the message, I found out. But what snippet changes the status?