implement GRIDs

This commit is contained in:
2018-08-01 22:19:30 +02:00
parent 8988df93fd
commit 755c65a42d
12 changed files with 203 additions and 37 deletions
+10 -3
View File
@@ -189,12 +189,19 @@ class TableController extends Controller
// Preparing data to insert into the Rows table
$rowsData = null;
try {
$rowsData = array_map(function ($row) use ($columns) {
if (count($row) == 0 || count($row)==1&&$row[0]=='') return null;
$grid_range = Row::allocateGRIDs(count($rowTable));
$grid_cnt = $grid_range[0];
$rowsData = array_map(function ($row) use ($columns, &$grid_cnt) {
if (count($row) == 0 || count($row) == 1 && $row[0] == '') return null;
if (count($row) != count($columns)) {
throw new NotApplicableException("All rows must have " . count($columns) . " fields.");
}
$parsed = [];
$parsed = [
'_grid' => $grid_cnt++
];
foreach ($row as $i => $val) {
$key = $columns[$i]->name;
if (strlen($val) > 255) {