开发者

Want to echo out html to extjs reader rather than json?

I am familiar with how to process json echoed data using datastores:

new Ext.data.Store({
        model: "VehicleInfo",
        proxy: {
            type: "ajax",
            url : "vehicleinfo.php",
            reader: {
                    type: "json"
            }
   开发者_开发知识库     },
        });     

But how do I configure the reader so that it accepts a html response? I plan to echo out the entire html response in a panel.

Thanks.


You may not want to use a store to update the panel contents. There are a few direct ways to update a panel body content. 1. Use the autoLoad in the config. 2. set html directly, possibly from some other ajax call. 3. use the Ext.Panel load method to have Ext make an ajax call and update the panel body with the response.

  panel = new Ext.Panel({
    renderTo: Ext.getBody(),
    width:450,
    frame:true,
    defaults:{autoHeight: true},
    // use autoLoad to have content created when the panel first renders
    autoLoad: 'vehicleinfo.php'
  });

  // use one or the other of the two below

  // set html directly
  panel.update('Examples of <strong>direct html<strong>');

  // set html by having Ext do an Ajax call to get panel content
  panel.load('vehicleinfo.php');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜