Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs4 如何在网格中显示Extjs.Ajax响应_Extjs4 - Fatal编程技术网

Extjs4 如何在网格中显示Extjs.Ajax响应

Extjs4 如何在网格中显示Extjs.Ajax响应,extjs4,Extjs4,我已经使用Ext.Ajax.request发布了表单数据,并得到了JSON的响应。现在我想在网格中显示这个JSON。我该怎么做?请帮我解决这个问题 以下是我的代码: var simple = new Ext.FormPanel({ labelWidth: 85, frame:true, title: 'Test on Demand', bodyStyle:'padding:10px 10px;',

我已经使用Ext.Ajax.request发布了表单数据,并得到了JSON的响应。现在我想在网格中显示这个JSON。我该怎么做?请帮我解决这个问题

以下是我的代码:

    var simple = new Ext.FormPanel({
          labelWidth:  85,
          frame:true,
          title: 'Test on Demand',
          bodyStyle:'padding:10px 10px;',
          width: 280,
          defaults: {width: 250},
          defaultType: 'textfield',
          items: [ combo, myText],

          buttons: [{
                text: 'Start',
                handler: function() { 
                    var rtu_id = combo.getValue();
                    var testplanid = myText.getValue();

                    Ext.Ajax.request({
                        url : 'http://localhost/rtu_ems_extjs/lib/action',
                        method: 'POST',
                        headers: { 'Content-Type': 'application/json'},                     params : { "action" : "rtu_request" },
                        jsonData: {
                            "rtu_id" : rtu_id,
                            "testplanid" : testplanid
                        },
                        success: function (response) {
                           var jsonResp = Ext.decode(response.responseText);
                           Ext.Msg.alert("Info",jsonResp.Type);
                        },
                        failure: function (response) {
                           var jsonResp = Ext.decode(response.responseText);
                           Ext.Msg.alert("Error",jsonResp.error);
                        }
                  });
                }
            }, {
                text: 'Reset',
                handler: function() {
                    simple.getForm().reset();
                }
            }]
});

simple.render(document.body);

我想在网格中显示'jsonResp'。

你找到了怎么做吗?