Renders an AG Grid-based editable table that loads data from SQL, supports inline editing with an optional Ace SQL editor, and saves changes via a transactional delete-then-insert RPC.
EDITTABLE — set as ReportType in def_report.
def Render(self, Param1="", Param2="", Param3="") -> str:
Params are passed through to the RPC on submit. The report reads self._Query, which must contain three SQL statements separated by ---: a SELECT query, a DELETE query, and an INSERT query (in that order). Returns an HTML fragment containing an AG Grid table with Add Row, Delete Selected, Submit Changes, and Cancel buttons.
RpcUpdatetable(data)Executes the provided delete SQL followed by parameterised INSERT statements for each row in a single transaction. Rolls back on any error. Returns {"success": True/False, "deleted": int, "inserted": int}.
self._Options must be a JSON array of AG Grid column definition objects (passed directly as columnDefs). Each column object supports standard AG Grid fields plus optional sqlEditor, sqlEditorAlways, sqlEditorWhenField, sqlEditorWhenValue, sqlEditorHeight, sqlEditorWidth, sqlEditorTheme, and sqlEditorMode keys to activate a pop-up Ace SQL editor for specific cells.
Loads AG Grid Community 31.0.1 from jsDelivr. Loads Ace editor from local resources (ace/ace.js, ace/mode-sql.js, ace/theme-dreamweaver.js). When the ReportCode is fs_feature_sets, an extra "Run Simulation" button appears that navigates to the FeatureStore simulation report. The query must use InnoDB tables so that the delete-insert can be rolled back on failure.