Re: Using .replaceWith() or .attr() in JsHelper::link ?

2012-12-04 Thread Salines
*I solved.*


   1. Use html helper for creating links
   2. jshelper for creating js code, use JsHelper :: get, JsHelper :: 
   event, and JsHelper :: Request
   

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Using .replaceWith() or .attr() in JsHelper::link ?

2012-12-04 Thread Salines
Hi,
I have a probably trivial question.

Can I put in cakephp JsHelper :: link options
other jQuery method, for example. replaceWith ()?

Clarification, on the admin page I have more links (twitter bootstrap 
buttons) on each individual record, one of the buttons should change when 
clicked.

Eg I need to change the following links

from


 



to


 



With JsHelper :: link, 'update' option we can change the contents inside 
  tags, in this case it's   tags.

My JsHelper link:

Js->link(
$this->Html->tag('i', '', array('class' => 'icon-ban-circle')), 
array(
'action' => 'publish',
$post['Post']['id'],
'1'),
array(
'class' => 'btn btn-warning',
'id' => $post['Post']['id'],
'update' => '#' . $post['Post']['id'],
'escape' => false),
false);
?>

http://pastebin.com/uDMjqdpN 

Thanks

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.