AnanthaKN / jquery-in-place-editor

Automatically exported from code.google.com/p/jquery-in-place-editor
Other
0 stars 0 forks source link

Callbacks aren't not tirggered #99

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

 Using callback setting not url.

 in the call back fucntion i'm using dwr to communicate with the server.  As this doesn't invoke a submit data via a post call the success method is never triggered. Once inside the callback method I can't find a way to easily access the settings variable so i can use the settings.success as a call back for dwr. 

Editing the handleSubmitToCallback fuction (line 450) 
from this.settings.params to this.settings 
was my crude solution. 

Did this because i couldn't find a way of accessing the settings.success 
function so i can use it as the callback to for my server side method (exposed 
by dwr) to call upon successful completion of server side operations.

==============================================
the code
===========================================

data.dataTable({
    "fnDrawCallback" : function() {
            /* Apply the jEditable handlers to the table */
    $('td', this.fnGetNodes()).editInPlace({
        "default_text" : "click to edit",
    "callback" : function(idOfEditor, enteredText, orinalHTMLContent, settings, callbacks) {
    var oTable = $('#quizTable').dataTable();
    var aPos = oTable.fnGetPosition(this);
    var aData = oTable.fnGetData(aPos[0]);

 //dwr server side call (passing in object and callback
        QuizManager.saveAll({
            "id" : aData.id,
            "name" : enteredText
                 },settings.success);   //better way to get success method?
                                        return enteredText;  //Fix me: foolish because asyncronous
                            },

    "success" : function(value) {
//called by dwr after success
            console.log(value);
            }
                        });

            }});

==============================================================
Java/Spring/DWR/Jquery/datatable/editinplace

Original issue reported on code.google.com by krazy...@gmail.com on 4 Aug 2011 at 8:27

GoogleCodeExporter commented 8 years ago
doh!  
Callbacks are not triggered if not using post 

Original comment by krazy...@gmail.com on 4 Aug 2011 at 8:28