I have the following jqGrid script:
jQuery("#editgrid").jqGrid({
url: "editing.php?q=1",
datatype: "xml",
// ...
Where should the url
point to if I am using Java instead PHP for creating the crud?
I have the following jqGrid script:
jQuery("#editgrid").jqGrid({
url: "editing.php?q=1",
datatype: "xml",
// ...
Where should the url
point to if I am using Java instead PHP for creating the crud?
It should just point to an URL where you've some Java code running and listening on the particular URL. In a Java webapplication you normally use a Servlet class for this. Just let the URL match the <url-pattern>
of the Servlet class as you've definied in the web.xml
. In the Servlet class you just implement doGet()
method accordingly to handle the HTTP GET request and response.
If you're using DWR, specify a function as your datatype (instead of "xml") that calls the DWR Javascript method. The DWR function's callback should then call the editGrid's addXMLData like so:
$("#editGrid")[0].addXMLData(xmlData)
note the [0] notation, which is neccesary. Details here: JQGrid Wiki: methods