Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/465.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在ExtJS面板中使用jQuery脚本_Javascript_Jquery_Extjs - Fatal编程技术网

Javascript 如何在ExtJS面板中使用jQuery脚本

Javascript 如何在ExtJS面板中使用jQuery脚本,javascript,jquery,extjs,Javascript,Jquery,Extjs,我有一个场景,我使用jQuery创建了我的头&这个头正在ExtJS中加载。同样,我使用下面的代码 var panel = new Ext.Panel({ autoHeight : true, html : <Some HTML code containing jquery scripts> }); var面板=新的外部面板({ 自动高度:正确, html: }); 但是由于一些未知的原因,我的头脚本无法工作 仅呈现HTML。控制台上也没有长时间的错误 任何建议

我有一个场景,我使用jQuery创建了我的头&这个头正在ExtJS中加载。同样,我使用下面的代码

var panel = new Ext.Panel({
    autoHeight  : true,
    html : <Some HTML code containing jquery scripts> 
});
var面板=新的外部面板({
自动高度:正确,
html:
});
但是由于一些未知的原因,我的头脚本无法工作

仅呈现HTML。控制台上也没有长时间的错误

任何建议都会很有帮助。

您可以按如下方式添加侦听器,并使用您想要的js或jquery, 参见示例

Ext.onReady(function(){

new Ext.Panel({
    renderTo: Ext.getBody(),
    frame: true,
    title: 'Test panel',
    height: 250,
    listeners: {
        render: function(){

            // this.body.dom is the raw dom object of the body element of this panel
            // render your plot to this.body.dom
            //write js / jquery

            console.log(this.body.dom)
            this.body.update('This is the new content');
        }
    }
});
}))

您可以按如下方式添加侦听器,并使用您想要的js或jquery, 参见示例

Ext.onReady(function(){

new Ext.Panel({
    renderTo: Ext.getBody(),
    frame: true,
    title: 'Test panel',
    height: 250,
    listeners: {
        render: function(){

            // this.body.dom is the raw dom object of the body element of this panel
            // render your plot to this.body.dom
            //write js / jquery

            console.log(this.body.dom)
            this.body.update('This is the new content');
        }
    }
});
}))

试试这个:

var panel = new Ext.Panel({
    autoHeight  : true,
    html : function(){
        return <Some HTML code containing jquery scripts> 
    }()
}); 
var面板=新的外部面板({
自动高度:正确,
html:function(){
返回
}()
}); 

panel.update = <Some HTML code containing jquery scripts>;
panel.update=;
试试这个:

var panel = new Ext.Panel({
    autoHeight  : true,
    html : function(){
        return <Some HTML code containing jquery scripts> 
    }()
}); 
var面板=新的外部面板({
自动高度:正确,
html:function(){
返回
}()
}); 

panel.update = <Some HTML code containing jquery scripts>;
panel.update=;

您正在使用一个框架。那么我不知道您为什么还要使用jQuery:/我支持,一个窗口中有两个怪物。:-)@_Green先生,@Damask实际上我必须在我的EXT-JS页面中包含一个现有的jQuery标题。@HemantKumar你检查过我下面的答案了吗?让我知道它是否对你有效。你正在使用一个框架。那么我不知道您为什么还要使用jQuery:/我支持,一个窗口中有两个怪物。:-)@_Green先生,@Damask实际上我必须在我的EXT-JS页面中包含一个现有的jQuery标题。@HemantKumar你检查过我下面的答案了吗?让我知道它是否对你有用。@U格林先生在我脑海里也有同样的问题。它的知识不会被浪费…:)@格林先生同样的问题在我脑海里也。它的知识不会被浪费…:)它不起作用。嗯,我正试图找出问题所在。我会随时通知你的。嗯,我正试图找出问题所在。我会随时通知你的。