最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Using Ext.Panel how do I specify a .php page as the html source? - Stack Overflow

programmeradmin1浏览0评论

I have an existing panel where I set the html manually with a variable like so:

s = '<H1>My Html Page';
s += '[more html]]';

 var panel = new Ext.Panel({
            id: 'service_Billing',
            title: 'Billing',
            tbar: [],
            html: s
        });

How can I specify a path on same server server of a .php file instead of the variable as the source of the html. Something like /path/example/data.php

I have an existing panel where I set the html manually with a variable like so:

s = '<H1>My Html Page';
s += '[more html]]';

 var panel = new Ext.Panel({
            id: 'service_Billing',
            title: 'Billing',
            tbar: [],
            html: s
        });

How can I specify a path on same server server of a .php file instead of the variable as the source of the html. Something like /path/example/data.php

Share Improve this question asked Apr 15, 2010 at 0:02 stormiststormist 5,88912 gold badges51 silver badges66 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

You're looking for autoLoad.

var panel = new Ext.Panel({
  autoLoad: '/path/example/data.php',
  id: 'service_Billing',
  title: 'Billing',
  tbar: []
});

Use Ext.Ajax to grab the content and update the panel:

var panel = new Ext.Panel(...);
Ext.Ajax.request({
  url: '/your/script.php',
  success: function(response,opts){
    opts.panel.update(response.responseText);
  },
  panel: panel
});

Or something like that ought to do it.

发布评论

评论列表(0)

  1. 暂无评论