- $control=$param->getDroppedControl();
- $item=$control->getNamingContainer();
- list(, , , $dragElementID, , ) = explode('_', $param->getDragElementID(), 6); // I know that it is ugly.
- if($dragElementID == $this->VersionsDataGrid->ID) {
- $fileid = $this->VersionsDataGrid->getDataKeys()->itemAt($item->getItemIndex());
+ $fileid = null;
+ if (isset($param->callbackParameter)) {
+ list(, , , $sourceElementID, , ) = explode('_', $sender->ClientID, 6);
+ $fileid = $param->callbackParameter;
+ } else {
+ $control = $param->getDroppedControl();
+ $item = $control->getNamingContainer();
+ list(, , , $sourceElementID, , ) = explode('_', $param->getDragElementID(), 6); // I know that it is ugly.
+ }
+ if($sourceElementID == $this->VersionsDataGrid->ID) {
+ if (is_null($fileid)) {
+ $fileid = $this->VersionsDataGrid->getDataKeys()->itemAt($item->getItemIndex());
+ }