I have a string:
var str = \"it\'s a beautiful day\";
I am passing this string to the function:
rowSave(id, str);
You can define a function similar to the following to build up the extra parameter object:
function encodeStr(str){
var s = str.split(' '), i, result = {};
for (i = 0; i < s.length; i++){
result['param' + i] = s[i];
}
return (result);
}
jQuery.ajax is used internally by jqGrid and may ensure proper serialization. If you run into problems, use encodeURIComponent to encode each parameter.
Anyway, then just call into this object when you specify your parameters:
"extraparam": encodeStr(str)