论坛首页 入门讨论版 EXT

autoLoad 页面的js或ext控件调用

浏览 1110 次
该帖已经被评为新手帖
作者 正文
最后更新时间:2008-03-25
var autoLoad = {url: 'sample.html', callback: function(){}, scope: this};
var gridPanel = new Ext.Panel({
title:"new panel test",
height:150,
width:600,
autoLoad: autoLoad                            });

利用autoLoad去加载页面的话,子页面怎样调用js,或者调用ext控件。
试了一下子页面js不好用
   
最后更新时间:2008-03-27
var autoLoad = {url: 'sample.html', callback: function(){}, scope: this,scripts:true};

增加一个scripts属性
   
0 请登录后投票
最后更新时间:2008-04-01
是的 加Script
   
0 请登录后投票
最后更新时间:2008-04-11
加了也不会执行
   
0 请登录后投票
最后更新时间:2008-04-11
我在listProduct.jsp的js文件(listProduct.js)中加了window组件,其中     
autoLoad:{url: '/my/pages/product/editProduct.jsp',scripts:true},中的editProduct.jsp如果在此jsp文件中直接加js脚本文件是就以运行的,如果通过 <script type="text/javascript" src="${ctx}/pages/product/editProduct.js"> </script>方法来引用脚本则不会运行?难道是EXT的Bug?

var win = new Ext.Window({
title:'新增产品',
     layout:'fit',
     width:500,
     height:300,
     closeAction:'close',
     modal: true, //  <-- 设置为 模式窗口,  
    
     autoLoad:{url: '/my/pages/product/editProduct.jsp',scripts:true},
      
    
     //
     //items: [
//  tab1
   // ],
    
   
     buttons: [{
        text:'关闭',
         handler: function(){win.close();}  
    }]
});

win.show();

    }
   
0 请登录后投票
最后更新时间:2008-04-28
zmfkplj 写道
我在listProduct.jsp的js文件(listProduct.js)中加了window组件,其中     
autoLoad:{url: '/my/pages/product/editProduct.jsp',scripts:true},中的editProduct.jsp如果在此jsp文件中直接加js脚本文件是就以运行的,如果通过 <script type="text/javascript" src="${ctx}/pages/product/editProduct.js"> </script>方法来引用脚本则不会运行?难道是EXT的Bug?

没错,我现在也被这个问题所困扰。是不是extjs在autoload函数中不支持这样的引用吗?
   
0 请登录后投票
最后更新时间:2008-07-24
autoLoad : Object/String/Function
A valid url spec according to the Updater Ext.Updater.update method. If autoLoad is not null, the panel will attempt ...
A valid url spec according to the Updater Ext.Updater.update method. If autoLoad is not null, the panel will attempt to load its contents immediately upon render.
The URL will become the default URL for this panel's body element, so it may be refreshed at any time.

官方文档上说的是只加载<body></body>中的,你要把你的<script type="text/javascript" src=""></script>加在<body>中,建议只用<div>,用了<html>在IE在报错,在firefox下没问题
   
0 请登录后投票
论坛首页 入门讨论版 EXT

跳转论坛:
JavaEye推荐