[jQuery] jEditable question

[jQuery] jEditable question

Barry,
I've added some code to show an error message.
Quite ugly solution though:
I catch all returned text, and look for the following string '[error]',
if it's found, I revert the form field text and alert the error.
The trick is to format the error texts well (ie containing the search
string). A more elegant solution would be something parameterized or
something like JSON, but this worked for me:
/* show the saving indicator */
$(self).html(options.indicator);
$(self).load(settings.url, p, function(str) {
self.editing = false;
         var curTxt = $(self).html();
         /* check for error and revert if found.
if(curTxt.indexOf('[ERROR]') != -1 ) {
    self.innerHTML = self.revert;
    alert(curTxt);
}
});
Cheers,
Miel
-----Original Message-----
From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com] On
Behalf Of Barry Nauta
Sent: dinsdag 24 oktober 2006 11:06
To: discuss@jquery.com
Subject: [jQuery] jEditable question
Hi all,
I have recently discovered jquery and jeditable.
When using jeditable, I discovered two things:
- Using firefox 1.0.8 jeditable does not return.
I can edit my text and the changes are saved in the database. However,
after
hitting the enter butting (and thus submitting the changes), the busy
icon is
show forever, it does not return. This is also true for the demos on
jeditable the site. Does ayone know how to fix this?
- Instead of a string, I would rather have some json structure returned
from
my backend with an optional error message. Anyone already done this?
Barry
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
















































    • Topic Participants

    • miel