I have a string:
var str = \"it\'s a beautiful day\";
I am passing this string to the function:
rowSave(id, str);
The code can be about the following:
var rowSave = function(id, str) {
var strParts = str.split(' '), l = strParts.length, i, obj = {},
codeStart = 'A'.charCodeAt(0); // 65
for (i = 0; i < l; i++, codeStart++) {
obj[String.fromCharCode(codeStart)] = strParts[i];
}
$("#myjqgrid").jqGrid('saveRow', id, {
succesfunc: function(response) {
return true;
},
url: "server.aspx",
mtype: "GET",
extraparam: obj
});
}
First the obj will be filled as {A: "it\'s", B: "a", C: "beautiful", D: "day"} and then it will be used as the value of extraparam.