jquery editable datatable update cell error
jquery editable datatable update cell error
karteekmvs
Posts: 3Questions: 0Answers: 0
Hi,
I am trying to update my datatable cell and I am using java servlet to process the data and update the database. However, when I send the 'value' of the cell changed back to the client using response.getWriter().printl(value), my cell update does not get reflected and I get a pop-up error box with no message and an ok button.
I setup a break point in my server-side code and the control is actually hitting it and I am able to retrieve the value of the cell and update the database.
Here's the code I am using:
[code]
$(document).ready( function () {
var id = -1;//simulation of id
$('#example').dataTable({ bJQueryUI: true,
"sPaginationType": "full_numbers"
}).makeEditable({
sUpdateURL: "/tools/servlet/UpdateData",
sAddURL: "/tools/servlet/AddData",
sAddHttpMethod: "GET",
sDeleteHttpMethod: "GET",
sDeleteURL: "/tools/servlet/DeleteData",
oAddNewRowButtonOptions: { label: "Add...",
icons: {primary:'ui-icon-plus'}
},
oDeleteRowButtonOptions: { label: "Remove",
icons: {primary:'ui-icon-trash'}
},
oAddNewRowFormOptions: {
title: 'Add a new browser',
show: "blind",
hide: "explode",
modal: true
} ,
sAddDeleteToolbarSelector: ".dataTables_length"
});
} );
[/code]
[code]
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class UpdateData extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
String id = request.getParameter("id");
String value = request.getParameter("value");
String columnName = request.getParameter("columnName");
String columnId = request.getParameter("columnId");
String columnPosition = request.getParameter("columnPosition");
String rowId = request.getParameter("rowId");
/* Update record */
PrintWriter out = response.getWriter();
out.println(value);
}
}
[/code]
I am more of a beginner in using the datatable and would appreciate anything basic that I am missing here or if I need to implement differently.
I am trying to update my datatable cell and I am using java servlet to process the data and update the database. However, when I send the 'value' of the cell changed back to the client using response.getWriter().printl(value), my cell update does not get reflected and I get a pop-up error box with no message and an ok button.
I setup a break point in my server-side code and the control is actually hitting it and I am able to retrieve the value of the cell and update the database.
Here's the code I am using:
[code]
$(document).ready( function () {
var id = -1;//simulation of id
$('#example').dataTable({ bJQueryUI: true,
"sPaginationType": "full_numbers"
}).makeEditable({
sUpdateURL: "/tools/servlet/UpdateData",
sAddURL: "/tools/servlet/AddData",
sAddHttpMethod: "GET",
sDeleteHttpMethod: "GET",
sDeleteURL: "/tools/servlet/DeleteData",
oAddNewRowButtonOptions: { label: "Add...",
icons: {primary:'ui-icon-plus'}
},
oDeleteRowButtonOptions: { label: "Remove",
icons: {primary:'ui-icon-trash'}
},
oAddNewRowFormOptions: {
title: 'Add a new browser',
show: "blind",
hide: "explode",
modal: true
} ,
sAddDeleteToolbarSelector: ".dataTables_length"
});
} );
[/code]
[code]
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class UpdateData extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
String id = request.getParameter("id");
String value = request.getParameter("value");
String columnName = request.getParameter("columnName");
String columnId = request.getParameter("columnId");
String columnPosition = request.getParameter("columnPosition");
String rowId = request.getParameter("rowId");
/* Update record */
PrintWriter out = response.getWriter();
out.println(value);
}
}
[/code]
I am more of a beginner in using the datatable and would appreciate anything basic that I am missing here or if I need to implement differently.
This discussion has been closed.
Replies