I'm trying to fill a gridadd table with teams using RowRendering to allow team entry. This worked in 2023, but now only partially fills the grid, and displays incorrect category values, using this code:
if(isset($this->RowIndex)) {
$grid_num = $this->RowIndex;
if(($grid_count >= $grid_num) && is_int($grid_num) && ($grid_num >= 1)) {
$offseter = $grid_num - 1;
if (Get("competition_type") == 0) {
//get & set product details
$team = ExecuteRow("SELECT a.team_id,a.category_id FROM team a
WHERE a.club_id = " . CurrentUserInfo("club_id") . "
ORDER BY a.category_do ASC, a.team limit 1
OFFSET $offseter");
}
if (Get("competition_type") == 0 && $team) {
$this->team_id->CurrentValue = $team["team_id"];
$this->category_id->CurrentValue = $team["category_id"];
var_dump($this->team_id->CurrentValue,$this->category_id- >CurrentValue,$grid_num);
}
if (Get("competition_type") == 1 && ($category)) $this->category_id->CurrentValue = $category["category_id"];
}
The var-dump shows team_id, category_id, and grid_num as i would expect, but in my example there are 4 teams, 4 rows are displayed, but only 2 filled in, and category is displayed incorrectly. What's changed since the 2023 version?