Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 2.85 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jqgrid Data not populating the Grid
  2. {
  3. "ROWS": [
  4.     {
  5.         "ID": 508,
  6.         "CELLS": {
  7.             "PHONE": "847-382-8872",
  8.             "STATE": "IL",
  9.             "ZIP": 60010,
  10.             "NAME": "Norton's U.S.A.",
  11.             "DESC": "We sell only products made in the United States!We offer an eclectic mix of common household items from toys to tools, glassware to garden supplies, fashions to food and so much more.  When you shop at Norton's U.S.A, you help keep America working!  ",
  12.             "CITY": "Riverwoods",
  13.             "ADDR": "400 Lageschulte Street"
  14.         }
  15.     }
  16. ],
  17. "PAGE": 1,
  18. "RECORDS": 1,
  19. "TOTAL": 1
  20. }
  21.        
  22. $(function(){
  23.   $("#list").jqGrid({
  24.     url:'cfc/buildData.cfc?method=getDining',
  25.     datatype: 'json',
  26.     mtype: 'GET',
  27.     colNames:['Member ID','Member Name', 'Address','City','Zip Code','State', 'Phone', 'Description'],
  28.     colModel :[
  29.       {name:'MEMBERID', index:'MEMBERID', jsonmap:'MEMBERID', width:60},
  30.       {name:'NAME', index:'NAME', jsonmap:'NAME', width:90},
  31.       {name:'ADDR', index:'ADDR', jsonmap:'ADDR', width:80, align:'right'},
  32.       {name:'CITY', index:'CITY', jsonmap:'CITY', width:80, align:'right'},
  33.       {name:'ZIP', index:'ZIP', jsonmap:'ZIP', width:80, align:'right'},
  34.       {name:'STATE', index:'STATE', jsonmap:'STATE', width:80, align:'right'},
  35.       {name:'PHONE', index:'PHONE', jsonmap:'PHONE', width:80, align:'right'},  
  36.       {name:'DESC', index:'DESC', jsonmap:'DESC', width:200, sortable:false}
  37.     ],
  38.     pager: '#pager',
  39.     rowNum: 10,
  40.     rowList:[10,20,30],
  41.     sortname: 'MEMBERID',
  42.     sortorder: 'desc',
  43.     viewrecords: true,
  44.     gridview: true,
  45.     caption: 'Lake County Members',
  46.  
  47.     jsonReader : {
  48.        root: "ROWS",
  49.        page: "PAGE",
  50.        total: "TOTAL",
  51.        records: "RECORDS",
  52.        repeatitems: true,
  53.        cell: "CELLS",
  54.        id: "MEMBERID",
  55.        subgrid: {root:"ROWS",
  56.           repeatitems: true,
  57.           cell:"CELLS"
  58.        }
  59.      }
  60.  
  61.   });
  62. });
  63.        
  64. {"id" :"1", "cell": ["cell11", "cell12", "cell13"]}
  65.        
  66. {"id": "abc", "col1": false, "col3": 123, "col2": "cell12"}
  67.        
  68. {"id": "abc", "col1": false, "coordinates": {"x": 123, "y": "cell12"}}
  69.        
  70. {
  71.     "ROWS": [
  72.         {
  73.             "ID": 508,
  74.             "PHONE": "847-382-8872",
  75.             "STATE": "IL",
  76.             "ZIP": 60010,
  77.             "NAME": "Norton's U.S.A.",
  78.             "DESC": "We sell only products made in the United States!We offer an eclectic mix of common household items from toys to tools, glassware to garden supplies, fashions to food and so much more.  When you shop at Norton's U.S.A, you help keep America working!  ",
  79.             "CITY": "Riverwoods",
  80.             "ADDR": "400 Lageschulte Street"
  81.         }
  82.     ],
  83.     "PAGE": 1,
  84.     "RECORDS": 1,
  85.     "TOTAL": 1
  86. }
  87.        
  88. jsonReader : {
  89.      root: "ROWS",
  90.      page: "PAGE",
  91.      total: "TOTAL",
  92.      records: "RECORDS",
  93.      repeatitems: false,
  94.      id: "ID",
  95.  }