this
inside the success function of the ajax call is another this
than the this
in the click function. So, you probably can't find the parent of that this
.
I guess you are trying to find the parent of the element to update the html right? Why don't you use Chtml::ajaxLink instead, then you can use the update property:
Chtml::ajaxLink(
'Remove',
$this->createUrl('//shop/shoppingCart/delete'),
array(
'update' => "$('.delete').parent()", // or anything like this
'data' => array(
'id' => $position,
)
),
array(
'class' => 'delete'
)
)