初心若禅 2014-12-25 02:13 采纳率: 0%
浏览 2161

extjs 代理 proxy 获取html里面json 的问题

这是extjs的代码
Ext.regModel('User',{
fields:[
{name: 'appeId'},
{name: 'survId'},
{name: 'location'},
{name: 'surveyDate'},
{name: 'surveyTime'},
{name: 'inputUserId'}
]

});
var proxy=new Ext.data.proxy.Ajax({
     type:'ajax',
      url:'survey.html' 
});

//构建Store   
    var store=new Ext.data.Store({
      proxy:proxy,
      model:'User',
      autoLoad: true,
      render:'json'


   });
store.add({appeId:'qwe',survId:'123',location:'123',surveyDate:'s',surveyTime:'s',inputUserId:'s'});
store.sync();
//载入
store.load();
// create the grid
var grid = new Ext.grid.GridPanel({
    store: store,        
    columns: [
        {text: "appeId", width: 60, dataIndex: 'appeId', sortable: true},
        {text: "survId", width: 60, dataIndex: 'survId', sortable: true},
        {text: "location", width: 60, dataIndex: 'location', sortable: true},
        {text: "surveyDate", width: 100, dataIndex: 'surveyDate', sortable: true},
        {text: "surveyTime", width: 100, dataIndex: 'surveyTime', sortable: true},
        {text: "inputUserId", width:80, dataIndex: 'inputUserId', sortable: true}
    ],
    renderTo:'example-grid',
    width:540,
    height:200
});



    这是survey.html
    [{"appeId":"1","survId":"1","location":"","surveyDate":"2008-03-14","surveyTime":"12:19:47","inputUserId":"1","inputTime":"2008-03-14

12:21:51","modifyTime":"0000-00-0000:00:00"}]

值传不过来啊,store.add 自己添加的能显示出来。

  • 写回答

4条回答 默认 最新

  • bdmh 移动开发领域优质创作者 2014-12-25 02:18
    关注

    你怎么返回的,是通过response.getWriter().println返回的吗

    评论

报告相同问题?

悬赏问题

  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?