Forum
16:46
03/05/2011
Hi,
JqGridImport is not working, I have a grid with 2 columns and 2 buttons, one to export the grid configuration and the other to import it back.
to export the grid I use the following command by storing the jsonstring in a global variable called 'options'
options = jQuery(
"#list").jqGridExport({ exptype: "jsonstring" });
then in the other button I import the settings back by using :
$(
"#list").jqGrid('jqGridImport', { imptype: "jsonstring", impstring: options, jsonGrid: { config: "grid", data: "data"} }).trigger("reloadGrid"); but it doesn't do anything but reloading the grid.
This my jsonstring:
----------------------------------------------------------------------------------------------------------------
{"grid":{
"url":"Inventory/GetIndexGridDatasss",
"height":"450",
"page":"1",
"rowNum":"5",
"rowTotal":null,
"records":"23",
"pager":"#pager",
"pgbuttons":"true",
"pginput":"true",
"colModel":[
{
"name":"Make",
"index":"Make",
"width":"237",
"align":"right",
"resizable":"true",
"edittype":"textarea",
"sortable":"true",
"sorttype":"text",
"editable":"true",
"title":"true",
"hidden":"false",
"widthOrg":"200"
},
{
"name":"Model",
"index":"Model",
"width":"236",
"align":"right",
"search":"true",
"sortable":"true",
"sorttype":"text",
"editable":"true",
"title":"true",
"hidden":"false",
"widthOrg":"200",
"resizable":"true"
},
{
"name":"VehicleKey",
"index":"VehicleKey",
"width":"1",
"hidden":"true",
"title":"true",
"widthOrg":"1",
"resizable":"true",
"sortable":"true"
}
],
"rowList":[
"5",
"10",
"20",
"50",
"100"
],
"colNames":[
"Make",
"Model",
"VehicleKey"
],
"sortorder":"asc",
"sortname":"Make",
"datatype":"local",
"mtype":"POST",
"altRows":"false",
"selarrrow":[],
"savedRow":[],
"shrinkToFit":"true",
"xmlReader":{
"root":"rows",
"row":"row",
"page":"rows>page",
"total":"rows>total",
"records":"rows>records",
"repeatitems":"true",
"cell":"cell",
"id":"[id]",
"userdata":"userdata",
"subgrid":{
"root":"rows",
"row":"row",
"repeatitems":"true",
"cell":"cell"
}
},
"jsonReader":{
"root":"rows",
"page":"page",
"total":"total",
"records":"records",
"repeatitems":"true",
"cell":"cell",
"id":"id",
"userdata":"userdata",
"subgrid":{
"root":"rows",
"repeatitems":"true",
"cell":"cell"
}
},
"subGrid":"false",
"subGridModel":[],
"reccount":"5",
"lastpage":"5",
"lastsort":"0",
"selrow":null,
"beforeSelectRow":null,
"onSelectRow":null,
"onSortCol":null,
"ondblClickRow":null,
"onRightClickRow":null,
"onPaging":null,
"onSelectAll":null,
"loadComplete":null,
"gridComplete":null,
"loadError":null,
"loadBeforeSend":null,
"afterInsertRow":null,
"beforeRequest":null,
"onHeaderClick":null,
"viewrecords":"true",
"loadonce":"true",
"multiselect":"false",
"multikey":"false",
"editurl":"clientArray",
"search":"false",
"caption":"Inventory",
"hidegrid":"true",
"hiddengrid":"false",
"postData":"["Make","Model","VehicleKey"]",
"userData":{},
"treeGrid":"false",
"treeGridModel":"nested",
"treeReader":{},
"treeANode":"-1",
"ExpandColumn":null,
"tree_root_level":"0",
"prmNames":{
"page":"page",
"rows":"rows",
"sort":"sidx",
"order":"sord",
"search":"_search",
"nd":"nd",
"id":"id",
"oper":"oper",
"editoper":"edit",
"addoper":"add",
"deloper":"del",
"subgridid":"id",
"npage":null,
"totalrows":"totalrows"
},
"forceFit":"false",
"gridstate":"visible",
"cellEdit":"false",
"cellsubmit":"remote",
"nv":"0",
"loadui":"enable",
"toolbar":[
"false",
""
],
"scroll":"false",
"multiboxonly":"false",
"deselectAfterSort":"true",
"scrollrows":"false",
"autowidth":"false",
"scrollOffset":"17",
"cellLayout":"5",
"subGridWidth":"20",
"multiselectWidth":"20",
"gridview":"false",
"rownumWidth":"25",
"rownumbers":"false",
"pagerpos":"center",
"recordpos":"right",
"footerrow":"false",
"userDataOnFooter":"false",
"hoverrows":"true",
"altclass":"ui-priority-secondary",
"viewsortcols":[
"false",
"vertical",
"true"
],
"resizeclass":"",
"autoencode":"false",
"remapColumns":[],
"ajaxGridOptions":{},
"direction":"ltr",
"toppager":"false",
"headertitles":"false",
"scrollTimeout":"40",
"data":[
{
"Make":"Ford",
"Model":"Mustang",
"VehicleKey":"2001489872",
"_id_":"1"
},
{
"Make":"Volvo",
"Model":"S40",
"VehicleKey":"2000888734",
"_id_":"2"
},
{
"Make":"Cadillac",
"Model":"CTS",
"VehicleKey":"2001891796",
"_id_":"3"
},
{
"Make":"Honda",
"Model":"Accord",
"VehicleKey":"2001672835",
"_id_":"4"
},
{
"Make":"Honda",
"Model":"Civic",
"VehicleKey":"2001888991",
"_id_":"5"
},
{
"Make":"Honda",
"Model":"Fit",
"VehicleKey":"2001865631",
"_id_":"6"
},
{
"Make":"Toyota",
"Model":"Corolla",
"VehicleKey":"2000511391",
"_id_":"7"
},
{
"Make":"Toyota",
"Model":"Tacoma",
"VehicleKey":"2001865634",
"_id_":"8"
},
{
"Make":"Acura",
"Model":"RDX",
"VehicleKey":"2001279460",
"_id_":"9"
},
{
"Make":"Scion",
"Model":"tC",
"VehicleKey":"2000770528",
"_id_":"10"
},
{
"Make":"Suzuki",
"Model":"Optima",
"VehicleKey":"2000545794",
"_id_":"11"
},
{
"Make":"Dodge",
"Model":"Nitro",
"VehicleKey":"2001833067",
"_id_":"12"
},
{
"Make":"Ford",
"Model":"Mustang",
"VehicleKey":"2000787019",
"_id_":"13"
},
{
"Make":"Yamaha",
"Model":"XV1700",
"VehicleKey":"2000000003",
"_id_":"14"
},
{
"Make":"Volkswagen",
"Model":"GTI",
"VehicleKey":"2001116816",
"_id_":"15"
},
{
"Make":"Mazda",
"Model":"RX-8",
"VehicleKey":"2000757855",
"_id_":"16"
},
{
"Make":"Mercedes-Benz",
"Model":"CLK-Class",
"VehicleKey":"2001118310",
"_id_":"17"
},
{
"Make":"Honda",
"Model":"Accord",
"VehicleKey":"2001248692",
"_id_":"18"
},
{
"Make":"Honda",
"Model":"Civic",
"VehicleKey":"2001116676",
"_id_":"19"
},
{
"Make":"Chinook",
"Model":"Concourse",
"VehicleKey":"2000363761",
"_id_":"20"
},
{
"Make":"Chrysler",
"Model":"PT Cruiser",
"VehicleKey":"2000790844",
"_id_":"21"
},
{
"Make":"Jaquar",
"Model":"Stratus",
"VehicleKey":"2000363760",
"_id_":"22"
},
{
"Make":"Ford",
"Model":"Crown Victoria",
"VehicleKey":"2001446583",
"_id_":"23"
}
],
"_index":{
"1":"0",
"2":"1",
"3":"2",
"4":"3",
"5":"4",
"6":"5",
"7":"6",
"8":"7",
"9":"8",
"10":"9",
"11":"10",
"12":"11",
"13":"12",
"14":"13",
"15":"14",
"16":"15",
"17":"16",
"18":"17",
"19":"18",
"20":"19",
"21":"20",
"22":"21",
"23":"22"
},
"grouping":"false",
"groupingView":{
"groupField":[],
"groupOrder":[],
"groupText":[],
"groupColumnShow":[],
"groupSummary":[],
"showSummaryOnHide":"false",
"sortitems":[],
"sortnames":[],
"groupDataSorted":"false",
"summary":[],
"summaryval":[],
"plusicon":"ui-icon-circlesmall-plus",
"minusicon":"ui-icon-circlesmall-minus"
},
"ignoreCase":"false",
"cmTemplate":{},
"recordtext":"View {0} - {1} of {2}",
"emptyrecords":"No records to view",
"loadtext":"Loading...",
"pgtext":"Page {0} of {1}",
"imgpath":"/Content/Images",
"width":"500",
"multipleSearch":"true",
"id":"list",
"keyIndex":"false",
"localReader":{
"root":"rows",
"page":"page",
"total":"total",
"records":"records",
"repeatitems":"false",
"cell":"cell",
"id":"_id_",
"userdata":"userdata",
"subgrid":{
"root":"rows",
"repeatitems":"true",
"cell":"cell"
}
},
"tblwidth":"483",
"disableClick":"false",
"_nvtd":[
"106",
"40"
],
"totaltime":"12",
"knv":null
}}
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Please help me figuring out what the problem is and would you provide a link if there is a full working example online exposing how it works.
Thanks in advance,
Alaa
Most Users Ever Online: 715
Currently Online:
44 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66