IDEMPIERE-457 Tab Editor (to ease positioning of fields) / implemente better grid behavior for droppable empty spaces

This commit is contained in:
Juan David Arboleda 2012-12-05 12:43:21 -05:00
parent 965e56e28a
commit a5a198f358
1 changed files with 15 additions and 11 deletions

View File

@ -215,9 +215,10 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
{
currentFieldGroup = fieldGroup;
if (numCols - actualxpos + 1 > 0) {
row.appendCellChild(createSpacer(), numCols - actualxpos + 1);
setLastCellProps(row.getLastCell(), actualxpos, field.getSeqNo());
while(numCols - actualxpos + 1 > 0) {
row.appendCellChild(createSpacer(), 1);
setLastCellProps(row.getLastCell(), actualxpos, field.getSeqNo());
actualxpos++;
}
row.setGroup(currentGroup);
rows.appendChild(row);
@ -259,9 +260,10 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
//normal field
if (gridField.getXPosition() <= actualxpos) {
// Fill right part of the row with spacers until number of columns
if (numCols - actualxpos + 1 > 0) {
row.appendCellChild(createSpacer(), numCols - actualxpos + 1);
setLastCellProps(row.getLastCell(), actualxpos, field.getSeqNo());
while(numCols - actualxpos + 1 > 0) {
row.appendCellChild(createSpacer(), 1);
setLastCellProps(row.getLastCell(), actualxpos, field.getSeqNo());
actualxpos++;
}
row.setGroup(currentGroup);
rows.appendChild(row);
@ -329,10 +331,12 @@ public class WTabEditor extends TabEditor implements IFormController, EventListe
lastseq = field.getSeqNo();
}
if (numCols - actualxpos + 1 > 0){
row.appendCellChild(createSpacer(), numCols - actualxpos + 1);
// make last empty space droppable
setLastCellProps(row.getLastCell(), actualxpos, lastseq + 10);
while(numCols - actualxpos + 1 > 0) {
row.appendCellChild(createSpacer(), 1);
lastseq = lastseq + 10;
// make every empty space droppable at the end
setLastCellProps(row.getLastCell(), actualxpos, lastseq);
actualxpos++;
}
row.setGroup(currentGroup);
rows.appendChild(row);