I have tree and grid interfaces. From tree, I’m creating a node like this which works fine:
var dp = new dataProcessor("CreateFolder.jsp");
myTree.getSelectedItemId(), //parent node id
myTree.getSelectedItemId()+"/"+name.value, //new node id
name.value, //new node label
However, I’m trying to delete from tree as follows, which doesn’t send parameters (which I could see in debug window):
var dp = new dataProcessor("DeleteFolder.jsp");
And in the grid as well, it doesn’t send parameters:
var selectedFiles = myGrid.getSelectedRowId();
var dp = new dataProcessor("DeleteFiles.jsp");
myGrid.setUpdated(selectedFiles, true, "deleted");
Could you please help?
Thanks in advance,
var dp = new dataProcessor(“CreateFolder.jsp”);
var dp = new dataProcessor(“DeleteFolder.jsp”);
var dp = new dataProcessor(“DeleteFiles.jsp”);
There can be only one dataprocessor for a component: one for grid and one for tree. And their objects needs have different name. For example:
var dpGrid = new dataProcessor(“updateGrid.jsp”);
var dpTree = new dataProcessor(“updateTree.jsp”);
You may use Connector to process data on server easily or use another approach for that (please see ready dataprocessor and connector samples).
If dataProcessor is correctly initialised, you don’t need to call setUpdated method after deleting item/row to send data to the server.
Thanks for the reply. I changed my code to have only one DP each for Grid and Tree. However, for Grid, as I mentioned earlier, it doesn’t seem to pass any parameters to my JSP. What I expect is myGrid.getSelectedRowId() so that on the server side I can take action on the selected files. Please let me know how I can pass this parameter.
I’m not using Connector because I need to use iBatis at the backend.
Thanks in advance,
Something like next can be used
dpGrid.serverProcessor = "updateGrid.jsp?selected="+mygrid.getSelectedRowId();
Thanks a lot! That worked well.