admin管理员组

文章数量:1422029

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.

本文标签: javascriptUsing ExtPanel how do I specify a php page as the html sourceStack Overflow