Results 1 to 2 of 2

Thread: Open a new View by clicking a link inside html (button)

  1. #1
    Sencha User
    Join Date
    Jun 2013
    Posts
    9
    Vote Rating
    0
      0  

    Default Unanswered: Open a new View by clicking a link inside html (button)

    How can I open a new View by pressing a link inside html? Something like this:

    Main.js

    Code:
    Ext.define('SkSe.view.Main', {    extend: 'Ext.tab.Panel',
        xtype: 'main',
        requires: [
            'Ext.TitleBar',
            'Ext.dataview.List'
        ],
        config: {
           tabBarPosition: 'bottom',
    
    
            items: [
                {
                    xtype: 'home'
                },
                {
                    xtype: 'placesContainer'
                },
                {
                    xtype: 'favoriti'
                },
                {
                    xtype: 'live'
                }
            ]
        }
    });


    Home.js
    Code:
    Ext.define('SkSe.view.Home', {    extend: 'Ext.Panel',
        xtype: 'home',
    
    
        config: {
            title: 'home',
            iconCls: 'home',
            layout: 'fit',
            styleHtmlContent: true,
            styleHtmlCls: 'homeView',
    
    
            html:[
                '<div class="cubePanel">Go to akcije.js</div>',
                '<div class="cubePanel">Go to live.js</div>',
                '<div class="scanPanel"></div>',
                '<div class="cubePanel">Go to favoriti.js</div>',
                '<div class="cubePanel">Go to map.js</div>'
            ].join("")
    
    
        }
    
    });


    Akcije.js
    Code:
    Ext.define('SkSe.view.Akcije', {    id: 'akcije',
        extend: 'Ext.Panel',
        xtype: 'akcije',
    
    
        config:{
    
    
            title:'Akcije',
                iconCls:'maps',
                layout:'fit',
                items:[
                {
                    xtype:'list',
                    store:'Places',
    
    
                    itemTpl:
                        '<img src="resources/icons/{icon}"></img>' +
                            '<h1>{name:ellipsis(25)}</h1>' +
                            '<p>Besplatan desert.</p>' +
                            '<p># {stamps}</p>',
    
    
                    itemCls:'place-entry'
                }
    
    
            ]
        }
    
    });

  2. #2
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    100
      0  

    Default

    I'm wondering what is the purpose of using the html like that? I'd rather use a button or a list.

    I think doing that in the html would be more difficult and require going through many DOM elements.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •