- Wed Jan 07, 2015 7:23 am
#781539
Hello!
I deleted a few lines of a grid (array) using the defined function, but when I went to re-display this information in a master form, the first column is empty, even though the records have been deleted properly.
Making debug the array, I noticed that the column key values that "disappeared" still exist, so I can assume is some difficulty in the form of displaying these values.
This anomaly only occurs after you unset this method. I submit the following code;
I deleted a few lines of a grid (array) using the defined function, but when I went to re-display this information in a master form, the first column is empty, even though the records have been deleted properly.
Making debug the array, I noticed that the column key values that "disappeared" still exist, so I can assume is some difficulty in the form of displaying these values.
This anomaly only occurs after you unset this method. I submit the following code;
Code: Select all
for ($i = 1, $tot = count(@=grid); $i < $tot; $i++) {
if (@=grid[$i]['procedimento'] == @@id_proc) {
unset(@=grid[$i]);
}
$i = 1;
$newGrid = array();
foreach (@=grid as $row) {
$newGrid[$i++] = $row;
}
}