1

I have been using the jeditable library for edit in place and it is working well in most cases. However, I now have a problem trying to show the selected text instead of the selected value when using the loadurl parameter. I've tried all of the solutions from this question however, they don't seem to work with loadurl instead of data. Here is the pertinent code below, and I also have a working (for the most part - except for this issue) test link here

$('.editableContact').editable(
function(value, settings) {
    jQuery.ajax({
        'type':'POST',
        'url':'/test/update.php',
        'data':$(this).attr('id')+'='+value,
        'cache':false,
        'success':function(rjson) {
            //r=JSON.parse(rjson);
            //console.log(r);
            //We could do a hacky solution here to over-write the cell data, requiring another lookup on the server when posting. 
        }
    });
    return 'Display of Selected Option (value is:'+value+')';
    //normal return: return(value);

    //None of these work:
    //return $(this).html(settings.data[value]);
    //return settings.data[value];            
    //jQuery.parseJSON(settings.data)[value];                    
},


{
placeholder:'Double Click to Edit',
submit  : 'save',
cancel : 'x',
event : 'dblclick',
type : 'select',
loadurl : '/test/getContactsJson.php'
});

Any help is appreciated - thank you!

Community
  • 1
  • 1
Keith Grey
  • 151
  • 7

0 Answers0