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

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