implement GRIDs
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user