Added new doTriggerEvent aoi method to grid aoi and fixed bug with scrolling in the grid and dragging

This commit is contained in:
Andreas Stöckel 2011-03-24 18:17:27 +00:00
parent e9c7e8b84d
commit ded17410ba
3 changed files with 21 additions and 2 deletions

View File

@ -107,7 +107,9 @@ function egwDragActionImplementation()
"start": function(e) {
return ai.helper != null;
},
"containment": $("body"),
// Solves problem with scroll position changing in the grid
// component
"refreshPositions": true,
"scroll": false
}
);

View File

@ -1316,6 +1316,7 @@ function egwGridViewRow_aoiSetup()
this.aoi._state = EGW_AO_STATE_NORMAL;
this.aoi.row = this;
this.aoi.doSetState = egwGridViewRow_aoiSetState;
this.aoi.doTriggerEvent = egwGridViewRow_aoiTriggerEvent;
this.aoi.getDOMNode = egwGridViewRow_aoiGetDOMNode;
}
@ -1335,6 +1336,19 @@ function egwGridViewRow_aoiGetDOMNode()
return this.row.parentNode ? this.row.parentNode.context : null;
}
function egwGridViewRow_aoiTriggerEvent(_event, _data)
{
if (_event == EGW_AI_DRAG_OVER)
{
this.row.parentNode.addClass("draggedOver");
}
if (_event == EGW_AI_DRAG_OUT)
{
this.row.parentNode.removeClass("draggedOver");
}
}
/**
* Returns the actionObjectInterface object of this grid item.
*/
@ -1825,4 +1839,3 @@ function egwGridViewFullRow_doSetViewArea()
}

View File

@ -30,6 +30,10 @@ body, td, th {
background-color: #b7c3ff;
}
.egwGridView_grid tr.draggedOver td {
background-color: #ffd09c !important;
}
/*.egwGridView_grid tr.selected.odd td {
background-color: #9dadff;
}*/