Passing parameters to url
Hi, I am new to javascript and jquery but found the jqgrid plugin very useful for what I am trying to do. I found a sample code online, which uses jqGrid with local data, you can find the complete code here:
http://jsfiddle.net/hE2GB/9/
I have added the two lines for "url" and "editdata" similar to the example code below to editsettings {} on line 114. It seems to be calling the url correctly, but for editdata, i want to pass the selected row as a parameter which doesn't seem to work using the code below.
My question is: How do I pass dynamic parameters to a url i.e. within the function below instead of id = grid[0].p.selrow? It seems that grid[0].p.selrow can only be called if it is within a function e.g. on line 196 in the complete code.
- editSettings = {
- recreateForm:true,
- jqModal:false,
- reloadAfterSubmit:false,
- closeOnEscape:true,
- closeAfterEdit:true,
- url: 'ajax/editRow',
- editdata: {id:grid[0].p.selrow},
- onclickSubmit:onclickSubmitLocal
- },
I have been googling everywhere but couldn't find an answer to this.
Any help would be appreciated.