I have a string:
var str = "it's a beautiful day";
I am passing this string to the function:
rowSave(id, str);
rowSave()
var rowSave = function(id, str){
jQuery("#myjqgrid").jqGrid('saveRow',id,{
"succesfunc": function(response) {
return true;
},
"url": "server.aspx",
"mtype": "GET",
"extraparam": {}
});
}
What I want to do
I want to
- split the string based on white space
- every word in the string (after splitting it) should be passed as a parameter in
extraparamso that it gets appended to the url.
I don’t know how to do this.
As per Oleg’s suggestion (see below), added in the ajaxRowOptions: {cache: false} in my jqgrid definition.
$("#myjqgrid").jqGrid({
ajaxRowOptions: {cache: false}
});
You can define a function similar to the following to build up the extra parameter object:
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: