Class "FormField_Table" - mudmin/UserSpice5-Dev GitHub Wiki
The FormField_Table is one of the more commonly used FormField classes as it allows the display of multiple records in a clear presentation of rows and cells. UserSpice supports pagination on long lists and also supports a very quick-and-easy "live" search capability as well (using FormField_SearchQ).
getInstance();
$fooData = $db->queryAll('foo')->results(); // contains columns `id` and `foo`
$myForm = new Form([
'delete' => new FormField_Table([
'data' => $fooData,
'th_row' => '<th>Mark for Deletion</th><th>Foo</th>',
'td_row' => '<td>{CHECKBOX_ID}</td><td>{FOO}</td>',
'checkbox_label' => 'Mark for Deletion',
]),
'delete_button' => new FormField_ButtonDelete([
'display' => 'Delete Marked Rows',
]),
], [
'dbtable' => 'foo',
'default' => 'processing',
]);