Jump to content


Photo

Using AJAX inline text edit


  • Please log in to reply
2 replies to this topic

#1 invi

invi

    Etomite Forum Newbie

  • Member
  • 4 posts

Posted 14 October 2010 - 03:54 PM

I'd like to implement a system like the Easy AJAX inline text edit on the front-end of my website. I can get it to work, but I'd like to keep the db-updating stuff inside etomite by using a snippet to handle the calls made by the jscript to update the DB. With an etomite-external update I can get it to work (calling another php-file) but when I try to get the same code functioning inside a snippet all hell breaks loose. I've tried a couple of different inline editing scripts, but they all seem to go bad when they're using a snippet. I've been thinking of hacking etomite so I can use the index.php with a simple if-thingy to skip etomite and use it to update the db, but that feels like cheating.

Does anyone have a functioning inline-editing script going within etomite?

(As stated before, my PHP-skills are limited to copying and fiddling a bit with copied code. Maybe there's a simple solution. (Though an empty template isn't it.))


#2 Ralph

Ralph

    Loves Etomite Forums!

  • Admin
  • 6,539 posts

Posted 14 October 2010 - 05:43 PM

When making an XMLHttpRequest call into Etomite it works best to use a blank template for the document holding the snippet call... Whether this is or isn't the solution to the problem is hard to say, but this might help steer you in the right direction...

#3 Cris D.

Cris D.

    Loves Etomite Forums!

  • Developers
  • PipPipPipPip
  • 1,106 posts

Posted 15 October 2010 - 08:09 AM

Here's a working example of AJAX in etomite and the code used to make it work based on an implemention of Ralph's AJAX library. While it is not an in-line editor, it may give you some food for thought. By having the form values post to a snippet, you *should* be able to send the data back and re display it but I was having difficulty making a snippet parse from an ajax request. Sounds like it would be a good addition to etomite functionality, but be careful the front and back end permissions are not confused while you implement it.

Edited by Cris D., 15 October 2010 - 08:15 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users