Multi-edit GUI: more progress
The MdhRecord
class now has a new paramater on its WriteAsFormElements()
method which determines whether the form is being written for a single record edit (in which case all the fields are filled with existing info, in the case of an existing record, and they're all enabled), or for multi-edit (in which case fields are empty and disabled by default, and provided with a checkbox to enable them if the user wants to set them). The following classes can now write themselves out in the form of enable-able and disable-able editing controls, so that the user can select which fields they want to change in the multiple records:
- MdhIntField
- MdhBoolField
- MdhStrField
- MdhStrLookupField
Remaining to be done:
- MdhDateField
- MdhLatLongField
- MdhLinkField
- MdhLinkSetField
- MdhLongTextField
- MdhOneToManyField
- MdhStrSelectField
- MdhTextField
I've also been giving some thought to how to refresh the table of search results from which the editable records were selected, and concluded that the simplest way to do this is simply to re-run the query that was last used. We're already storing the last search query parameters in the spreadsheetSearch
array, which is indexed by table name, so we can simply re-run it; although since we'll now be using it for two different purposes, it should probably be renamed to something like "lastSearch
". Running a single search query will mean that only one query hits the db (as opposed to trying to update every row that's changed in the current table), and it will also solve the problem of rows which should disappear from the table because they no longer match the current query. We can cause this query to run by using the funcToCall
parameter to the AJAX sendRequest()
method.