function listing_deleteKeyword($id)
{
//Search for the keyword
$result = $this->Keyword->findAll($criteria="account_id = '" .
$this->Xauth->getId() . "' and Keyword.id = '" . $id . "'");
if ($result)
$this->Keyword->del($id);
}
function listing_editallkeywords($id = null)
{
//request came in to delete a keyword.
if($id)
{
//if the request came in through ajax.
if($this->RequestHandler->isAjax())
{
$this->listing_deleteKeyword($id);
$this->autoRender=false;
}
}
$this->order = 'Keyword.' . $this->sortBy.'
'.strtoupper($this->direction);
$data = $this->Keyword->findAll($criteria="account_id = '" .
$this->Xauth->getId() . "'", $fields=null, $this->order, $this->show,
$this->page);
//ListingID ($id) is invalid.
if (empty($data))
{
$this->redirect('/advertisers/listing_viewlisting/');
}
$paging['style'] = 'ajax';
$paging['link'] =
'/bare/advertisers/listing_editallkeywords/?show='.$this->show.'&sort='.$this->sortBy.'&direction='.$this->direction.'&page=';
$paging['count'] = $this->Keyword->findCount($criteria="account_id = '"
. $this->Xauth->getId() . "'",'50');
$paging['show'] = array('10','25','50');
$paging['page'] = $this->page;
$paging['limit'] = $this->show;
$paging['direction'] = $this->direction;
$this->set('paging',$paging);
$this->set('data',$data);
$this->set('arr_validation_errors', $arr_validation_errors);
$this->render(null,null,null,'listing');
}
---> I tried requestHandler->isAjax, and its not helping, it rendering
the view inside the view inside the view...
I change the very last line to:
if($this->RequestHandler->isAjax())
{
$this->autoRender=false;
}
else
{
$this->render(null,null,null,'listing');
}
and it shows the view but it remove the the listing... I'm confused.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---