gabotorr / jquery-datatables-editable

Automatically exported from code.google.com/p/jquery-datatables-editable
0 stars 0 forks source link

sDeleteUrl always returns failure status and fails to delete Row #161

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I have the following libraries
        <style type="text/css" title="currentStyle">
        @import "/js/datatables/media/css/demo_page.css";
        @import "/js/datatables/media/css/demo_table.css";

        </style>
        <script type="text/javascript" language="javascript" charset="utf-8" src="/js/datatables/media/js/jquery.js"></script>
        <script type="text/javascript" language="javascript" charset="utf-8" src="/js/datatables/media/js/jquery.dataTables.min.js"></script>
        <script type="text/javascript" language="javascript" charset="utf-8" src="/js/datatables/media/js/jquery.jeditable.js"></script>
        <script type="text/javascript" language="javascript" charset="utf-8" src="/js/datatables/media/js/jquery.dataTables.editable.js"></script>
        <script type="text/javascript" language="javascript" charset="utf-8" src="/js/datatables/media/js/jquery-ui.js"></script>
        <script type="text/javascript" language="javascript" charset="utf-8" src="/js/datatables/media/js/jquery.validate.js"></script>

2. and the following is my makeEditable code
oTable.makeEditable({
                                    sDeleteRowButtonId: "btnDeleteTask",                                    
                                    sUpdateURL: "/servlets/ProjectScopeScratchPadServlet?FWAction=update&sessionId="+sessionId+"&item=1",
                                    sDeleteURL: "/servlets/ProjectScopeScratchPadServlet?FWAction=deleteTask&sessionId="+sessionId,                                                                                                         
                                    fnOnDeleting: function(tr, id)
                                    {   
                                        $("#trace").append("Deleting row with id " + id);
                                        return true;
                                    },
                                    fnOnDeleted: function(status)
                                    {       
                                            alert(status+" deleting Tasks");
                                    },                                  
                                        "aoColumns": [
                                                        null,
                                                        null,
                                                        { indicator: 'Saving...',
                                                            tooltip: 'Click to edit Description',
                                                            loadtext: 'loading...',
                                                            "onblur": "submit",

                                                            oValidationOptions : 
                                                                       { 
                                                                           rules:{ 
                                                                                   value: {                                                                                                  
                                                                                             maxlength: 30                                                                                                                                                              
                                                                                          }
                                                                           },
                                                                           messages: { 
                                                                                   value: {
                                                                                        maxlength: "Description can only be upto 30 characters" } 
                                                                           }
                                                                       },
                                                            callback: function( sValue, x) {                                                            
                                                            var aPos = oTable.fnGetPosition( this );                                                                                                                                                                 
                                                            oTable.fnUpdate( sValue, aPos[0], aPos[1], true, true);
                                                             }  
                                                         },
                                                        null,
                                                        null,
                                                        null,
                                                        null,
                                                        null,
                                                        null,
                                                        null,
                                                        null
                                                        ]       
                });

What is the expected output? What do you see instead?
When i press my "delete" button, I am returning "ok" from my servlet, but it 
always shows a failure status in the alert. And it fails to delete the record 
too.

What version of the product are you using? On what operating system?
I am using jQuery v1.8.2 on IE.

Please provide any additional information below.
Please let me know what i am doing wrong.

Original issue reported on code.google.com by asif.h1...@gmail.com on 28 Oct 2013 at 10:06