Tag Archives: jquery

Easy AJAX calls in CakePHP

 CakePHP is a great framework for rapid development of web based applications that serves well the principles of DRY (Do not Repeat Yourself). However unlike other web frameworks, CakePHP is not (and probably will not) fully AJAX based (for instance, you could check the list of PHP Ajax frameworks or try some Java/Python implementations such as Google Web Toolkit and Pyjamas). 

In no way the statement above means that you cannot do some flexible and dynamic client-side calls into your CakePHP site. You could freely use plain Javascript in your views, use the JS helper of CakePHP or add some prototype/jQuery library and take advantage of its features. Beyond all that possibilities you could use one more helper of Cake - the AJAX helper. The AJAX helper provides an intuitive interface for maintaining some standard task with only few lines of code.

Some of the methods that you can use with the Ajax helper:

  • link
  • remoteFunction
  • form
  • observeField
  • autoComplete
  • drag & drop

and few more that you could find in the link above. 

The standard 1.2 implementation expects prototype and scriptaculous in order to run properly. However you could easily replace them with jQuery (and jQuery UI) libraries. Some examples on that: http://www.cakephp.bee.pl/

 

del.icio.us Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati ReadMe.ru Dobavi.com Dao.bg Lubimi.com Ping.bg Pipe.bg Svejo.net Web-bg.com

BubbleTip – jQuery bubble tooltip

 

I had to implement a bubble tooltip helper for a client. After a short research I tried the Coda Popup Bubbles.  Useful plugins that worked great for a couple of days, when I set it for a single text field and 2 browsers only. When I decided to integrate it as a platform independent snippet and add it to 10 more textfields, I hit a rock - indents from bubble to the textfield were not consistent, bubble was popping over the textfield etc. Some images were also missing - left and right borders in Firefox and the bottom arrow in Internet Explorer.

I used to hack the Javascript and CSS for 3 days and finally got stuck. I found a workaround working since then - the BubbleTip plugin, which is a modification of the upper one, but acting better in different browsers. Also, it's using an automatic offset which makes it far more useful when you have different text in bubbles.

del.icio.us Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati ReadMe.ru Dobavi.com Dao.bg Lubimi.com Ping.bg Pipe.bg Svejo.net Web-bg.com