International Distributors
As of FactoryPMI 3.3.0, the Table component supports editing in its cells. This feature allows the user to edit cell data by double clicking in the cell. The information can then be sent back to the SQL database without creating a form in FactoryPMI. This article describes how to setup and configure the table to allow editing. Step 1: Drag a Table Component into the Window
SELECT * FROM customers
# The row index of the edited row row = event.row # The column index of the edited column col = event.column # The column's name colName = event.source.data.getColumnName(col) # The new value value = event.newValue # The primary key's value (first column), so that the appropriate row can be updated in the db id = event.source.data.getValueAt(row, 0) # Run an update query to the table that is being edited to reflect any changes fpmi.db.runPrepStmt("UPDATE customers SET %s = ? WHERE ID = ?" % colName, [value, id])