public function dropItem() {
		Configure::write('debug', 0);
		if (!$this->_controller->request->is('ajax') || !$this->_controller->request->is('post') ||
			!$this->_controller->RequestHandler->prefers('json')) {
			throw new BadRequestException();
		}

		$id = $this->_controller->request->data('target');
		$newParentId = $this->_controller->request->data('parent');
		$oldParentId = $this->_controller->request->data('parentStart');
		$dropData = $this->_controller->request->data('tree');
		$dropData = json_decode($dropData, true);
		$result = $this->_model->moveDrop($id, $newParentId, $oldParentId, $dropData);
		$data = compact('result');
		$this->_controller->set(compact('data'));
		$this->_controller->set('_serialize', 'data');
	}
public function dropItem() {
		Configure::write('debug', 0);
		if (!$this->_controller->request->is('ajax') || !$this->_controller->request->is('post') ||
			!$this->_controller->RequestHandler->prefers('json')) {
			throw new BadRequestException();
		}

		$id = $this->_controller->request->data('target');
		$newParentId = $this->_controller->request->data('parent');
		$oldParentId = $this->_controller->request->data('parentStart');
		$dropData = $this->_controller->request->data('tree');
		$dropData = json_decode($dropData, true);
		$result = $this->_model->moveDrop($id, $newParentId, $oldParentId, $dropData);
		$data = compact('result');
		$this->_controller->set(compact('data'));
		$this->_controller->set('_serialize', 'data');
	}
public function dropItem ( ) { Configure :: write ( 'debug' , 0 ) ; if ( ! $ this -> _controller -> request -> is ( 'ajax' ) || ! $ this -> _controller -> request -> is ( 'post' ) || ! $ this -> _controller -> RequestHandler -> prefers ( 'json' ) ) { throw new BadRequestException ( ) ; } $ id = $ this -> _controller -> request -> data ( 'target' ) ; $ newParentId = $ this -> _controller -> request -> data ( 'parent' ) ; $ oldParentId = $ this -> _controller -> request -> data ( 'parentStart' ) ; $ dropData = $ this -> _controller -> request -> data ( 'tree' ) ; $ dropData = json_decode ( $ dropData , true ) ; $ result = $ this -> _model -> moveDrop ( $ id , $ newParentId , $ oldParentId , $ dropData ) ; $ data = compact ( 'result' ) ; $ this -> _controller -> set ( compact ( 'data' ) ) ; $ this -> _controller -> set ( '_serialize' , 'data' ) ; }
Action `dropItem`. Used to drag and drop item.

POST Data:
- `target` The ID of the item to moving to new position;
- `parent` New parent ID of item;
- `parentStart` Old parent ID of item;
- `tree` Array of ID subtree for item.

@throws BadRequestException if request is not AJAX, POST or JSON.
@return void
Action dropItem . Used to drag and drop item .