Forum
My grid is set to method type post and datatype of json. I see the output that is echoed is not rendered in the grid and I was wondering why this might be? I made use of json_encode and the code example for loading json data. This array does not load into the grid though. I will past my script below as well.
[CODE]
{"page":"1","total":1,"records":"33","rows":[{"id":"40","cell":["40","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","91360","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"41","cell":["41","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","91364","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"42","cell":["42","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","93021","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"43","cell":["43","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"44","cell":["44","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","93063","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"45","cell":["45","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","91387","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"46","cell":["46","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"48","cell":["48","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","91423","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"49","cell":["49","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","91355","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"50","cell":["50","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","91605","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"51","cell":["51","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","91377","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"52","cell":["52","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","93063","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"53","cell":["53","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","93021","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"54","cell":["54","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","93012","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"55","cell":["55","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","93001","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"56","cell":["56","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","93021","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"57","cell":["57","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"58","cell":["58","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","93063","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"59","cell":["59","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","91360","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"60","cell":["60","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"61","cell":["61","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","91377","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"62","cell":["62","Jack","Doe","112 Button Hollow Pl.","","Gotham","CA","91301","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"63","cell":["63","Jill","Doe","112 Button Hollow Pl.","","Gotham","CA","92833","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"64","cell":["64","Jane","Doe","112 Button Hollow Pl.","","Gotham","CA","91406","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"65","cell":["65","Janet","Doe","112 Button Hollow Pl.","","Gotham","CA","90025","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"66","cell":["66","Sepopotimus","Maximus","315 Eagle Ridge St.","","Newbury Park","CA","91307","(805) 555-1212","jdoe@gmail.com","(805) 555-1212"]},{"id":"67","cell":["67","Eric","Sepich","315 Eagle Ridge St.","","Newbury Park","CA","91320","(805) 402-8072","sepich.eric@gmail.com","(805) 555-1212"]},{"id":"68","cell":["68","Sepotomus","Minimus","315 Eagle Ridge St.","","Newbury Park","CA","91320","","",""]},{"id":"70","cell":["70","Julius","Cesar","111 Etu","Brute Ct.","Rome","","","","",""]},{"id":"75","cell":["75","Marhsal","Mathers","12075 E. Presilla Rd","","Camarillo","CA","91320","","",""]},{"id":"76","cell":["76","Steve","Mathers","Little Hollow","","Moorpark","","","","",""]},{"id":"77","cell":["77","Phil","Esposito","","","Palmdale","","","","",""]},{"id":"79","cell":["79","aaa","aaa","","","","","","","",""]}]}
[/CODE]
08:21
Moderators
30/10/2007
Hello,
How look your grid configuration?
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
$(function(){
var lastSel;
jQuery("#grid-customers").jqGrid({
url:'php.scripts/get.customers.json.php',
datatype: 'json',
mtype: 'POST',
colNames:['idcustomers','firstname', 'lastname','address1','address2','city','state','zip','phone','email','cell'],
colModel :[
{name:'idcustomers', index:'idcustomers', width:55, jsonmap: 'idcustomers'},
{name:'firstname', index:'firstname', width:90, editable: true, jsonmap: 'firstname'},
{name:'lastname', index:'lastname', width:90, editable: true, jsonmap: 'lastname'},
{name:'address1', index:'address1', width:90, editable: true, jsonmap: 'address1'},
{name:'address2', index:'address2', width:90, editable: true, jsonmap: 'address2'},
{name:'city', index:'city', width:90, editable: true, jsonmap: 'city'},
{name:'state', index:'state', width:90, editable: true, jsonmap: 'state'},
{name:'zip', index:'zip', width:90, editable: true, jsonmap: 'zip'},
{name:'phone', index:'phone', width:90, editable: true, jsonmap: 'phone'},
{name:'email', index:'email', width:90, editable: true, jsonmap: 'email'},
{name:'cell', index:'cell', width:90, editable: true, jsonmap: 'cell'}
],
pager: '#grid-customers-pager',
rowNum:100,
rowList:[100,200,300],
sortname: 'idcustomers',
sortorder: 'desc',
viewrecords: true,
gridview: true,
caption: 'Customers',
height: 375,
width: 1200,
editurl: 'php.scripts/update.row.php',
ajaxGridOptions: {type:"POST"}
}).navGrid('#grid-customers-pager',{ edit: false, add: true }, {}, {}, {}, {}, {}).inlineNav("#grid-customers-pager",{});
jQuery("#grid-customers").jqGrid('filterToolbar',{autoSearch: true});
});
08:44
Moderators
30/10/2007
Hello,
Not sure what you do and how you do it.
Your example works perfectley at my end. I have copy paste your exmple and it works without modification.
If you want I can post it online. Please check your response for other errors.
By the way if you use jsonReader with repeatitems set to true (as in your case) you do not need to use jsonmap in colModel
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
09:01
Moderators
30/10/2007
By the way you have some error in the code.
Replace
.navGrid('#grid-customers-pager',{ edit: false, add: true }, {}, {}, {}, {}, {}).inlineNav("#grid-customers-pager",{});
with
jQuery("#grid-customers")
.jqGrid('navGrid','#grid-customers-pager',{ edit: false, add: true }, {}, {}, {}, {}, {})
.jqGrid('inlineNav',"#pager",{});
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
42 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