I have the following jqGrid:
I make an AJAX call to display elements on that grid. I wanted to show more items on the grid (same tab) and made another AJAX call.
So, I created 2 arrays. The first array stores the result of Ajax Call 1, the second array stores the result of Ajax Call 2.
I concatenated these arrays and displayed them on the grid:
var test3 = test1.concat(test2);
thegrid.addJSONData(test3);
So far so good, the only problem is, that when I want double click the item on the grid, it can only use the same path for every item, meaning that it can open only 1 form and not different ones.
That's because when clicking the grid, it calls this function:
ondblClickRow: function (rowid, iRow, iCol, e) {
onDoubleClickGrid(rowid, iRow, iCol, e, divname, listname);
}
Here's the entire function:
function onDoubleClickGrid(rowid, iRow, iCol, e, divname, listname, useFormToOpen) {
var rowData = $("#" + divname).getRowData(rowid);
var curID = rowData.Id;
var useForm = "EditForm.aspx";
if (checkNull(useFormToOpen)!="") {
useForm = useFormToOpen;
}
var curPath = "/MM/Lists/" + listname;
// var curPath = "/nderungsantrag/Lists/" + listname;
var url = curPath + "/" + useForm + "?ID=" + curID;
openInDialog(dlgWidth, dlgHeight, true, true, true, url);
}
I tried working with flags, but these won't work here because the objects are all in the merged array, and it can't differentiate them.
Is it possible to get the object values of the element that was clicked ondblClickRow? Because then I could use a for loop and check for the properties of the object. Depending on what property it has, I could change the path. Or is there another way to accomplish this?