Uppercase P enables native record positioning. Lowercase p is simultaneous-use protection and is a different option. Enable P on the Table View and the Add form when inserted rows participate in the same position sequence.
$subsection->setOption([
'name' => ['en'=>'VIEW ITEMS','es'=>'VER ELEMENTOS','fr'=>'VOIR ELEMENTS'],
'type' => 'VPN', 'privilege' => 4
]);
// On the owning Add form, with an existing pos column:
$nextpos = 'last';
The default first position is1. last uses the maximum existing pos plus1, or1 for an empty table. A numeric $nextpos supplies an explicit position. Existing zero values remain valid when native drag sorting stores row indexes.
$posCol = 'pos'; $orderby = $posCol; $showpos = true; $query = "SELECT * FROM $dbtable %%WHERE%% ORDER BY pos, $idfield";
Identifiers above are trusted page configuration for a table that already has those columns. If using another position column, set posCol to that actual column. Allowlist requested sort columns/directions instead of placing raw URL values in SQL. Use stable tie ordering and test the unfiltered view; search, filters and other sort choices can suppress positioning controls. See Sort Columns for the independent header-sort contract.
Full arrays are the modern extensible configuration. Strings remain supported legacy shorthand/quick syntax. Prefer full arrays for new definitions; use only keys supported by the owning field or component.