相关疑难解决方法(0)

将html文件加载到面板中

我是sencha touch 2.0的新手.我有一个html文件.我正在尝试将此html文件(或内容)加载到面板中.我只是使用ajax调用,但它不起作用.以下是代码.

这是我在浏览器中运行的html文件.

index.html:

<script type="text/javascript" src="touch/sencha-touch-debug.js"></script>
<script type="text/javascript" src="HTMLPanel.js"></script>
<script type="text/javascript" src="app.js"></script>
Run Code Online (Sandbox Code Playgroud)

这是app.js:

Ext.setup({
    name : 'SampleLoad',
    requires : ['HTMLPanel'],
    launch : function () {
        var HTMLPanel = new HTMLPanel({
            scroll : 'vertical',
            title : 'My HTML Panel',
            url : 'sample.html'
        });
    }
});
Run Code Online (Sandbox Code Playgroud)

这是HTMLPanel.js:

//HTMLPanel = Ext.extend(Ext.Panel, { //gives error 
var HTMLPanel = Ext.define('HTMLPanel',{
    extend : 'Ext.Panel',
    constructor : function( config ) {
        HTMLPanel.superclass.constructor.apply(this, arguments);

        // load the html file with ajax …
Run Code Online (Sandbox Code Playgroud)

sencha-touch-2

14
推荐指数
2
解决办法
2万
查看次数

标签 统计

sencha-touch-2 ×1