After having exported data using jqGridExport we import using jqGridImport. First problem was that the bottom bar options did not come back so I added that code after. So code looks like:
$("#list").jqGridImport({imptype: 'jsonstring', impstring: gridSettings})
.jqGrid('navGrid','#pager', { edit: false, add: false, del: false, search: true, refresh:true },
{},{},{},{closeOnEscape: true, multipleSearch: true, closeAfterSearch: true},{});
The critical part of the gridSettings string is:
"postData":{"_search":true,
"nd":1301031279941,
"rows":20,
"page":1,
"sidx":"a.ID",
"sord":"asc",
"filters":{"groupOp":"AND","rules": [{"field":"fname","op":"bw","data":"T"}]}
}
Everything comes up fine except for the search. The one line of search from postData above is correct but there is a second search line, which I can only describe as the default search line. If I go in and remove that line from the multiple search box everything is as it should be.
So my question is first, why does multipleSearch not come back up when I restore using jqGridImport?
Second is there a way to programmatically remove the second search line?
grid[0].p.postData.filters
has typestring
. If you has an object instead of string then you do something wrong in your code before that. You should post the code which you use. I have seen at the beginning that"filters":{"groupOp":"AND","rules": [{"field":"fname","op":"bw","data":"T"}]}
which you posted is definitive wrond value. the value must be converted to JSON withJSON.stringify
for example. I don't know whether it is your bug or the bug injqGridExport
/jqGridImport
. – Vouvray