Jqgrid conflicting with wordpress query vars
I have written a wordpress plugin that uses jqgrid. When I submit one of the rows in the jqgrid to be saved, the names in my table columns (like "name") are conflicting with the wordpress query vars and causing a 404 to be开发者_JS百科 returned.
Is there any way to get the jqgrid post to be wrapped in another object, so it's not posting the raw query var "name" to the server? Can it post something like
$_POST = array(
'jqgrid' = array('oper' => 'add', 'name' => 'whatever')
);
instead of
$_POST = array('oper' => 'add', 'name' => 'whatever');
?
jqGrid has prmNames option which can be used to rename any of the parameters used in URL or POST by jqGrid. For example default value for the "add" operation are defined by addoper:"add"
.
I don't understand what you mean under the "name" parameter. the column name are not used as the name of any parameter which are posted. If you have the problem because of the usage of toolbar searching I would recommend you to use stringResult:true
option which makes information about the searching in the same format like in case of the usage of advanced searching. If you describe the problem more detailed I am sure that I could help you.
UPDATED: You can use serializeEditData (for form editing), serializeRowData (for inline editing) or serializeCellData (for cell editing) to convert in any way the data which will be send to the server during Edit/Add operation.
精彩评论