Как отобразить ответ Extjs.Ajax в сетке - PullRequest
1 голос
/ 30 марта 2012

Я разместил данные формы, используя 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' в сетке.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...