0

I'm using the example shown in this post. It's working great, but I have trouble getting the indicator to show. Is there anyone that can explain why it doesn't work? Here's my code, mostly the same as above link:

<script type="text/javascript">
$(document).ready(function() {
    $('.edit').editable(submitEdit, {
        tooltip: "Click...",
        indicator: "Saving...",
        type: "text",
    });


    function submitEdit(value, settings){
        var edits = new Object();
        var origvalue = this.revert;
        var textbox = this;
        var result = value;
        edits[settings.name] = value;
        edits[settings.id] = this.id;
        var returned = $.ajax({
            url: '/account/venues/rename/',
            type: "POST",
            data : edits,
            dataType : "json",
            complete: function(xhr, textStatus){
                var response = xhr.responseText;
            }

        });
        return(result);
    };
});
</script>

I should mention that the code insubmitEdit is not finished by any means, since I'd like the indicator to work first. Also, I've been trying both 1.6.2 and 1.7.2-dev of jeditable.

Thank you!

Community
  • 1
  • 1
mistalaba
  • 558
  • 1
  • 7
  • 19

2 Answers2

0

The indicator will be ignored if you are using a custom function for the target (submitEdit). If its a URL, then the indicator will be shown. That's how jeditable plugin is coded.

0

Could you show us your code, including jQuery and jEditable versions? Else it's pretty hard to help you out.

You could start with the exact (copy/paste) example and see if that works for you, and then adjust it step by step, checking after each change.

dyve
  • 5,893
  • 2
  • 30
  • 44
  • Well, the example code on jeditable homepage did work, but I needed the extra functionality of calling a function so I could get proper error handling. – mistalaba Nov 03 '10 at 11:05