| Method | Parameters | Returns | Description |
|---|---|---|---|
| jqGridExport | options | Exports the the current grid configuration to the desired format
$("#mygrid").jqGridExport({exptype:"xmlstring"});
will export the current grid configuration as xml string
$("#grid_id").jqGridExport({exptype:"jsonstring"});
will export the current grid configuration as json string.
It is good idea first to play with this option before using jqGridImport. |
|
| jqGridImport | options | Reads the grid configuration according to the rules in options and constructs the grid. When constructing the grid for first time it is possible to pass data to it again with the configuration. |
IMPORTANT NOTE:
When using these methods the pager parameter should not be set as
but aspager: jQuery("#mypager"),
orpager : "#mypager"
pager : "mypager"
otherwise the import or export will not work.
| Option | Values | Description | Default |
|---|---|---|---|
| imptype | xml, json, xmlstring, jsonstring | "xml" | |
| impstring | in case of xmlstring or jsonstring this should be set | "" | |
| impurl | valid url to the configuration when xml or json | "" | |
| mtype | "GET" or "POST" | "" | |
| impData | {} | additional data that can be passed to the url | empty array |
| xmlGrid | {} | describes from where to read the xml configuration and from where the data if any
config : "roots>grid", data: "roots>rows" |
|
| jsonGrid | {} | describes from where to read the json configuration and from where the data if any
config : "grid", data: "data" |
If the data tag is empty, the grid automatically loads the data according to the url and datatype options of the grid.
options :{ imptype : "xml", // xml, json, xmlstring, jsonstring impstring: "", // in case of xmlstring or jsonstring this should be set impurl: "", // valid url to the configuration when xml or json mtype: "GET", // the type "GET" or "POST" impData : {}, // additional data that can be passed to the url xmlGrid :{ // describes from where to read the xml configuration and from where the data if any config : "roots>grid", data: "roots>rows" }, jsonGrid :{ // describes from where to read the json configuration and from where the data if any config : "grid", data: "data" } }
As a further example of what is needed, the distribution package contains two files: json_test.txt and xml_test.xml to show the different (xml and json) configurations.