The Trash button isn't working properly in a custom component in Joomla 3.x. It's behaving a bit weirdly. What happened when I tried to select a particular file or file list and then click the Trash button and that particular file or file list is still showing there (it supposed to move from the original location to the trashed box location when we hit the trash button, but here it stays in both location). And in the same time that particular file or file list also can be seen to the Trashed box as well where I just need to select that file and click the Empty Trash button. Empty Trash button is working fine.
The problem is that the file is showing in both location after click Trash button. It's look like some code is missing in this custom component and that's why the Trash button isn't working the way it should worked.
The only code I found related to this is the following:
if ($this->state->get('filter.state') == -2 && $canDo->get('core.delete'))
{
JToolbarHelper::deleteList('', 'kpcnews.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($canDo->get('core.edit.state'))
{
JToolbarHelper::trash('kpcnews.trash');
}