前天面试的复试题中gird

Code:
  1. Ext.onReady(function(){   
  2.     var cm = new Ext.grid.ColumnModel([   
  3.         new Ext.grid.RowNumberer(),   
  4.         {header:'employeeId',dataIndex:'employeeId',sortable:true },   
  5.         {header:'employeeName',dataIndex:'employeeName',sortable:true},   
  6.         {header:'employeebType',dataIndex:'employeebType',sortable:true },   
  7.         {header:'employeePhoto',dataIndex:'employeePhoto',sortable:true },   
  8.         {header:'employeeDate',dataIndex:'employeeDate',sortable:true },   
  9.         {header:'employeePlace',dataIndex:'employeePlace',sortable:true },   
  10.         {header:'employeeMarriage',dataIndex:'employeeMarriage',sortable:true },   
  11.         {header:'employeeIdCard',dataIndex:'employeeIdCard',sortable:true },   
  12.         {header:'employeeBirthPlace',dataIndex:'employeeBirthPlace',sortable:true },   
  13.         {header:'hireDate',dataIndex:'hireDate',sortable:true },   
  14.         {header:'outDate',dataIndex:'outDate',sortable:true },   
  15.         {header:'state',dataIndex:'state',sortable:true },   
  16.         {header:'position',dataIndex:'position',sortable:true },   
  17.         {header:'salary',dataIndex:'salary',sortable:true },   
  18.         {header:'account',dataIndex:'account',sortable:true},   
  19.         {header:'address',dataIndex:'address',sortable:true },   
  20.         {header:'telephone',dataIndex:'telephone',sortable:true },   
  21.         {header:'phone',dataIndex:'phone',sortable:true },   
  22.         {header:'email',dataIndex:'email',sortable:true }   
  23.     ]);   
  24.        
  25.     var store= new Ext.data.Store({   
  26.   
  27.         proxy:new Ext.data.HttpProxy({url:'GridServlet?method=list'}),   
  28.        //这里url不能用struts的方法,struts方法mapping forward会使out.print(jsonData)的数据无法被找到,而用servlet方法无返回值直接out.print(jsonData)就OK了,这问问题我搞了两天,害的我没完工   
  29.         reader:new Ext.data.JsonReader({}, //这里的root、totalProperty没搞定,加这俩参数就不显示数据了,真是的Ext的文档也够详细,网上也没有具体的例子看,如果哪位看到了帮忙解决一下啊
  30.                 [   
  31.                 {name:'employeeId'},   
  32.                 {name:'employeeName'},   
  33.                 {name:'employeebType'},   
  34.                 {name:'employeePhoto'},   
  35.                 {name:'employeeDate'},   
  36.                 {name:'employeePlace'},   
  37.                 {name:'employeeMarriage'},   
  38.                 {name:'employeeIdCard'},   
  39.                 {name:'employeeBirthPlace'},   
  40.                 {name:'hireDate'},   
  41.                 {name:'outDate'},   
  42.                 {name:'state'},   
  43.                 {name:'position'},   
  44.                 {name:'salary'},   
  45.                 {name:'account'},   
  46.                 {name:'address'},   
  47.                 {name:'telephone'},   
  48.                 {name:'phone'},   
  49.                 {name:'email'}   
  50.                    
  51.             ])   
  52.         });   
  53.     store.load();   
  54.     var grid =  new Ext.grid.GridPanel({   
  55.         renderTo:'grid',   
  56.         title:'ExtJs TEST',   
  57.         store:store,   
  58.         cm:cm,   
  59.         loadMask:{msg:'正在加载数据……'},   
  60.         width:800,   
  61.         height:200   
  62.            
  63.            
  64.     });   
  65.     grid.render();     
  66.        
  67. });  
  68.  
  69.  
  70.  

 

 

 

你可能感兴趣的:(前天面试的复试题中gird)