Examples:

Complex options:

Dolor

<div class="edit" id="div_1">Dolor</div>
<?php
echo $ajax->editor( 
    "div_1", 
    array( 
        'controller' => 'ajax', 
        'action' => 'edit2',
    ), 
    array(
        'indicator' => '<img src="/img/indicator.gif">',
        'submit' => 'OK',
        'style' => 'inherit',
        'submitdata' => array('id'=> 2),
        'tooltip'   => 'Click to edit...'
        )
);
?>   
            

Select editor:

Edit me

<div class="edit" id="div_2">Edit me</div>
<?php
echo $ajax->editor( 
    "div_2", 
    array( 
        'controller' => 'ajax', 
        'action' => 'edit2',
    ), 
    array(
        'indicator' => '<img src="/img/indicator.gif">',
        'submit' => 'OK',
        'type' => 'select',
        'data' => array('Lorem ipsum'=>'Lorem ipsum','Ipsum dolor'=>'Ipsum dolor','Dolor sit'=>'Dolor sit'),

        )
);
?>
   
            

Comments

  1. Rystraum wrote:

    I made a sort-of tutorial on how to use the above editor, with the controller and view code.

    http://rystraum.com/blog/2010/04/cakephp-and-ajax-inline-editing/

  2. alx wrote:

    make sure to use $this->params in stead of $this->data in your controller action

  3. Regz wrote:

    This helper is awesome... keep updating your helper...

  4. Ay Dot wrote:

    The editor isn't working. is it a conflict ?

  5. Denis wrote:

    hi,
    does anyone see a problem with this code:

    <div class="tblEntry" id="div_username" style="width: 30%; font-variant: normal;">
    <?php echo $agent['User']['username'];
    echo $ajax->editor("div_username",array(
    'controller'=>'users',
    'action'=>'edit',$user['User']['id']),
    array(
    'submit'=>'Accept',
    'style'=>'inherit',
    'submitdata'=>array('id'=>2),
    'tooltip'=>'sdsg'));
    ?>
    </div>

    thanks in advance,
    denis

  6. Denis wrote:

    The above code is included in the main page through $ajax->link. Also included the jeditable js file but it still does not work.
    Can anyone help?

    thank you,
    denis

  7. kvas wrote:

    Hi Denis!
    I think that the problem is that you loads editor by ajax request and the js handler are not triggered... Try to run editor on normal page and see if its work...

  8. Denis wrote:

    hi kvas,

    thank you for the suggestion..unfortunately my design of the website is to load the page through ajax in a certain <div>. Is there anyway around this issue?

    thank you,
    denis

  9. kvas wrote:

    I think that you should use your own jQuery scripts. Helper is not designed for this kind of operations :(

  10. Denis wrote:

    hi kvas,

    I tested the script the way you mentioned and it still does not work. the view is loaded correctly but the editor still does not show up. any other ideas?

    thank you,
    denis

  11. Denis wrote:

    Hi kvas,

    updates on my problem: there is no problem with the helper or the script, it was a typeo on my part...

    thanks for the help,
    denis

  12. ryan wrote:

    it's missing the event 'onedit' when the mouse is clicked.

    You can add this to $this->editorOptions and options to string.

  13. ryan wrote:

    Actually, don't add to _optionsToString as it's not a function of the object ;)

  14. kvas wrote:

    Hi ryan,
    Actually 'onedit' event is not documented, so I don't know if it'll be suppod in new versions.

  15. james wrote:

    Thanks for the nice helper. I tried to update single field and it works but how can I update multiple fields?
    If possible can you post the controller code also it will help me a lot.

  16. james wrote:

    Thanks for the nice helper. I tried to update single field and it works but how can I update multiple fields?
    If possible can you post the controller code also it will help me a lot.

  17. alfadaemon wrote:

    Hi Kvas, just one comment. I was having a lot of trouble getting this Ajax editor to work, and after some weeks I realize that the jquery.jeditable.js was needed!!.... please comment at the beginning of this that the plugin is required.

  18. coach outlet wrote:

    The Nordstrom http://www.coachfactoryonline.name Anniversary Sale is probably my favorite sale of the year, aside from finding a random amazing bag deal at a sample sale or by http://www.wwwcoachoutlet.us.com Coach Outlet Online 70% OFF.One of the biggest stressors for me, and I'm sure others, is sorting through the sale items and making sure I find not only great deals but also what I'm looking for. Lucky for you, I narrowed down some of my Coach Outlet, http://www.coachoutletstore.us.com favorite items for you!http://www.christianlouboutinoutlet.us.com

    While the http://www.beatsbydrdre.us.com Anniversary Sale is still only open to card members, it will open to http://www.ray-banpascher.com the public this Friday, July 22nd. Keep in mind this sale is not like others; these items will go http://www.ray-banoutletstore.us.com back to full price once the sale ends. So either let my picks help you http://www.wwwraybansunglasses.us.com now or wait until Friday http://www.raybanoutletsunglasses.us.org to check it all out and nab some great deals. http://www.raybanonlineoutlet.us.com Shop the entire Outlet Online - http://www.coachoutletstoress.us.com Coach Outlet sale now!http://www.louboutinoutlet.us.com

    Seeing http://www.michaelkorsoutletwebsite.us.com Coach Outlet Stores Online, http://www.coachoutletstoresonline.us.com Coach Factory Outlet anything too frequently for too long will make people sick of it, which is why some of you guys complain when we write another post concerning classic bags like the Coach Flap Bag or Hermès Birkin. Familiarity breeds contempt. http://www.us-coachoutlet.us.com Coach USA Store When it comes to handbags, "contempt" is probably too strong a word, but there comes a point in time where you're ready for a brand to acknowledge it's done all with a certain style that it can. The Marcie feels like it's ready to cycle out to me, especially when you consider the slightly different aesthetic direction of the brand's more recent offerings. http://www.chiflatironwebsite.us.com CHI Flat Iron Like a beloved football player for one of my favorite teams, I hope the http://www.coachoutletonline.us.com Coach Outlet Online Store 2016 Marcie will go out while it's still on top.http://www.clshoesoutletonline.com

    In fact, the textured material gives a very luxe and bohemian finish that correlates easily with many summer wardrobes. I especially love suede http://www.coachoutletusaonline.us.com sandals because the material takes color so well, which makes the sandals especially vivid. If you want some examples of http://www.coachfactory.name Coach Factory http://www.coach-factoryonline.us.com how to wear http://www.coachpurses.us.com them, look no further than Rosie Huntington-Whiteley and Chrissy Coach Outlet - http://www.coachfactoryonline.us.com ,Factory Outlet Online http://www.coach-factorystore.us.com Teigen.http://www.hermesbirkinoutlet.us.com

    Summer always seems to go by in the blink of an eye, but because of suede's traditional associations with cooler weather,Coach Outlet USA http://www.coachonlineoutletstore.us.com ,Coach Outlet Online these sandals will help ease the transition to fall! http://www.coachoutletonline.us Coach Outlet Online US http://www.coachfactoryoutletinc.us.com Check out our favorites http://www.giuseppezanotti.us.com Giuseppe Zanotti below.

    Even http://www.outletonlineclearance.com Coach Outlet Online Store though we are, of course, big http://www.coachfactoryoutlet-stores.us.com proponents of buying a brand new bag, sometimes you don't need a brand new bag. Maybe the budget doesn't allow for one, maybe you just got a http://www.coach-factoryoutletstores.us.com great deal at the http://www.coachoutlets.us recent seasonal sales and you're set for a http://www.coachoutletonlinesale.us.com while, maybe http://www.coach-factoryoutletstore.us.com you just don't have the itch right now--whatever the reason, it http://www.coachoutletstoreonlines.us.com happens to all of us http://www.coachoutletstorefactory.us.com sometimes. If this sounds http://www.valentinoshoes.us.com familiar to you but you'd still like to update your daily accessories for fall, http://www.valentinooutlet.org maybe we suggest a http://www.raybanoutletsonline.us.com bag charm?http://www.redbottomshoe.us.com

    Bag http://www.valentinorockstud.us.com charms are sometimes polarizing among our readers, primarily because http://www.raybansunglassoutlet.us.com some of them are extremely expensive, despite being non-functional. That doesn't have to be the case, though--we had no problem finding nearly two dozen cute, playful options, and many of them have two-digit http://www.oakleyonlineoutlet.us.com price tags. That's the great thing http://www.raybansunglassescheap.us.org about a bag charm: they don't have to http://www.rayban-outlet.us.com be serious or expensive, but they can be both or neither, depending on your opinion and personal budget.http://www.tomsoutlet.us.com

    In general, even at http://www.raybansunglassesstore.us.com the http://www.oakleyonlinestore.us.com high end, these charms http://www.ray-bansunglasses.org are much less of a commitment than a designer bag--if you use it for a season to http://www.raybanoutletsunglass.us.com make an old favorite feel new, you won't have to feel http://www.bananelouisvuitton.com wasteful if you tuck it back in your closet in a few months in favor of the next thing http://www.valentinoshoesoutlet.us.com that catches your fancy. When http://www.raybaneyeglasses.us.com that bag starts to http://www.oakleyoutlet.name feel normal, http://www.louisvuittonlv.us.com though, your charm will be right http://www.factorystoreonline.com where you left it to provide a little extra accent.http://www.sacnoirpascher.com

    Last week celebs http://www.oakleyoutletsonline.us.com partied down with http://www.ray-bansunglasses.it politics, http://www.christianlouboutinoutletonline.us.com and Gigi Hadid managed to http://www.outlet-michaelkors.us.com stay one http://www.abercrombieoutletonline.us.com step ahead of us http://www.ralphlauren-outlet.us.com with her handbag choices. http://www.sacpascherhermes.com Also, Margot Robbie has finally begun her super stylish press tour for Suicide Squad, and we expect our photo service to be pretty generous with her http://www.oakleysunglassesstore.us.com pictures for http://www.oakleysunglassoutlet.us.com the foreseeable http://www.oakleysunglassesonsale.us.com future. That's good news for Margot Robbie fans and bag lovers alike, because her handbag http://www.poloralphlaurenoutlet.us.com picks are http://www.michaelkorsfactoryoutletonline.us.com top-notch.

    Here's Orange is the New Black http://www.oakleyoutletstores.us.org star Diane Guerrero outside of the http://www.oakleyvaultsunglass.us.com Chemical Heritage Foundation Museum in http://www.oakleyoutletstores.us.com Philly with Elizabeth Banks, http://www.michaelkorsoutletonlines.us where they both attended an "anti-obesity" luncheon together. Diane is carrying a black leather Wallet on Chain Bag.

    Greetings friends and bag lovers! http://www.michaelkorsoutletsale.us.com Unbelievably, this is our last visit in July, and we hope your summer is going well. Our http://www.oakleysunglassesoutletstore.us.com members have been shopping up a storm, and we are happy once again to bring you some of the best bags and http://www.cheapoakleysunglasses.com.co conversations from the PurseForum. This week, http://www.michaelkors.us.com some nice bags from Givenchy caught our eye, and we also looked http://www.michaelkors-outletonline.us.org inside some Chanel bags and caught up with Louis Vuitton’s newest Speedy. All this and more, just for you.

    The Givenchy http://www.truereligionjeans.us.org Antigona is http://www.michaelkorsoutletonlines.us.com still one of the most popular bags in the http://www.truereligionoutletco.us.com world, and http://www.michaelkorsoutletco.us.com emiliagunawan is so impressed with her two-year old Antigona that she http://www.polosralphlauren.us.com posted a reveal, just to share the love and let our members know what a durable bag this is. We really appreciate these reviews and updates–our forum is about sharing information. Lapetite7 picked up a new bag this week: a mini Pandora Box in classic black. Also, miacostigan showed off her first Givenchy, which was a http://www.valentinoshoesoutlet.com decision made with help from her PurseForum http://www.raybanssunglasses.us.com friends.

    Somehow it's going to be http://www.michael-korsoutletonline.com August by the time we see you again on Monday, which seems impossible until http://www.tomsshoe.us.com you remember that summer always flies by as New Yorkers hurtle straight back to http://www.michaelkorsoutletsonline.us.com the inevitable winter that it feels like just ended. In the meantime, before we http://www.michaelkorsonlineoutlets.us.com progress on to the last month of summer, it's time to look back http://www.onlinemichaelkorsoutlet.us.com and see what we learned and http://www.michaelkorssoutlet.us.com enjoyed in July.

    Below, check out http://www.modeldesac.com the http://www.michaelkors-outlet-online.com five most popular posts we published this http://www.michael-kors.us.com month--your fellow readers have some very http://www.valentinorockstudshoes.us.com good taste, and we http://www.michaelkorsonline.us.com know you're not doing much at work on a summer Friday afternoon anyway.http://www.valentinoshoes.us.org

    Last http://www.valentinooutlet.us.org year http://www.pradaoutletstore.us.com for National Handbag Day, I went about reading my handbag tea leaves to figure out what http://www.true-religions.us.com your handbag choices say about you. This year, in http://www.tomsoutlet.in.net celebration of the holiday's second coming on Friday, I've returned with a new set of highly covetable bags to do the same. http://www.christian-louboutinshoes.us.com Check out the results below.

    What we’ve set out to do is http://www.tomsshoesoutletonline.in.net create an http://www.pascherportefeuille.com Birkin price list for three http://www.truereligionoutletonline.in.net of the most common leathers–Clemence, http://www.valentinoshoeswebsite.com Togo and Epsom–in the four sizes that are commonly used as women’s handbags. Right now, we’re focusing on the US, eurozone Europe, http://www.louboutinshoes.us.com the United Kingdom and Japan, http://www.christianlouboutinsale.us.com which are the http://www.hermesbag.us.com four global markets for which http://www.north-faceoutlet.us.com pricing information is http://www.beatsbydrdreheadphone.us.com most available. Below, check out our findings, pulled from both http://www.marcjacobsoutlet.us.org our PurseForum and price http://www.truereligionoutlet.us.com lists across the web.

    The information is http://www.sacportefeuillespascher.com incomplete, but we’ll be filling it in as much as possible as we find more information. If you http://www.portefeuillepascher.com know any current prices that aren’t represented below,http://www.portefeuillespascher.com please let us know in the http://www.sacblanc.com http://www.valentinoshoes.com.co comments!

    Prices Last Updated: July 2016 http://www.valentino.com.co

  19. Jordan 4 wrote:

    http://www.nfljerseys.us/ NFL Jerseys from China

    http://www.yeezyboost350.us.com/ Yeezy Boost 350

    http://www.longchampbags.us.com/ Longchamp Outlet

    http://www.adidas-uk.org.uk/ Adidas Sale

    http://www.raybansoutlet.us/ Ray Ban Outlet

    http://www.yeezys.org/ Yeezys For Sale

    http://www.tomsoutlet-online.us.com/ Toms Outlet Online

    http://www.kade-sapde.us.com/ Kade Sapde Outlet

    http://www.adidasoutlets.us.com/ Adidas Outlet

    http://www.nike-stores.fr/ Nike Stores

    http://www.underarmouroutlet.us.com/ Under Armour Outlet

    http://www.timberlanduk.org.uk/ Timberland Boots

    http://www.jordan12.us/ Jordan 12

    http://www.yeezy-shoes.us.com/ Yeezy Shoes

    http://www.nikehuarache.us/ Nike Huarache

    http://www.kedsshoesforwomen.com/ Keds Shoes

    http://www.yeezy.com.co/ Yeezy

    http://www.nikeairmax.us/ Nike Air Max 2016

    http://www.outlettoms.us/toms-women-c-1/ Toms Outlet

    http://www.ultraboostuncaged.us/ Ultra Boost Uncaged

    http://www.mlb-jerseys.us/ MLB Jerseys

    http://www.adidas-nmds.com/ Adidas NMD

    http://www.oakleyoutlet.net.co/ Oakley Outlet

    http://www.rayban-canada.ca/ Ray Ban

    http://www.katespadeoutlets.us/ Kate Spade Outlet

    http://www.adidas-outlet.org/ Adidas Outlet

    http://www.nikeairmax-90.com/ Nike Air Max 90

    http://www.timberland-outlet.us/ Timberland Outlet

    http://www.rayban-sunglasses.ca/ Ray Ban Sunglasses

    http://www.adidas-nmd.org.uk/ Adidas NMD

    http://www.adidaseqt.com/ Adidas EQT

    http://www.ralphlaurens.org.uk/ Ralph Lauren

    http://www.jordan4.us/ Jordan 4

    http://www.cheapjordan-shoes.com/ Cheap Jordan

    http://www.adidasnmdoutlet.com/ Adidas NMD

    http://www.katespadeoutlet.us.org/ Kate Spade

    http://www.longchamp-outlet.ca/ Longchamp

Post a comment

 

Additional options:

  • $options['var'] - name of variable that stores handler to editable method
 

jQuery Ajax Helper

CakePHP is distributed under flexible licence - MIT Licence. I decided to publish my code on the same licence, so you can freely use IT!

If I made you interested go and download it now!