1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    7
    Vote Rating
    0
    morikalina is on a distinguished road

      0  

    Default Answered: Can't click anywhere..

    Answered: Can't click anywhere..


    The problem is I cannot click anywhere (toolbar items, list items).
    I tried Ext.application instead of Ext.setup, and didn't work either.

    You can check live here: http://77.79.103.188:81/HamaratAlfa/enes/index.php

    Code:
    Ext.application({
    	viewport :
    	{
    		layout : 'fit',
    		scroll : 'vertical'
    	},
    	launch : function()
    	{
    		Ext.Viewport.add(Ext.create('Ext.Panel',
    		{
    			items : [tabPanel],
    			layout : 'fit'
    		}));
    
    
    	}
    });
    So here is my JS code

    Code:
    Ext.setup({
    	viewport :
    	{
    		layout : 'fit',
    		scroll : 'vertical'
    	},
    	onReady : function()
    	{
    		this.add(Ext.create('Ext.Panel',
    		{
    			items : [tabPanel],
    			layout : 'fit'
    		}));
    
    
    	}
    });
    
    
    var data = [
    {
    	no : "12312"
    },
    {
    	no : "32341"
    }];
    
    
    var list = Ext.create("Ext.List",
    {
    	title : "TestList",
    	itemTpl : "<div>number: {no}</div>",
    	iconCls : 'settings',
    	data : data
    
    
    });
    var tabPanel = Ext.create('Ext.TabPanel',
    {
    	defaults :
    	{
    		styleHtmlContent : true
    	},
    	tabBar :
    	{
    		docked : 'bottom',
    		layout :
    		{
    			pack : 'center'
    		}
    	},
    	defaults :
    	{
    		scroll : 'vertical'
    	},
    	items :[list,
    	{
    		title : 'de',
    		html : '<h2>Home</h2>',
    		iconCls : 'home',
    		cls : 'card card1'
    	},
    	{
    		title : 'Team',
    		html : '<h2>Team</h2>',
    		iconCls : 'team',
    		cls : 'card card2'
    
    
    	},
    	{
    		title : 'Favorites',
    		html : '<h2>Favorites</h2>',
    		iconCls : 'favorites',
    		cls : 'card card3'
    	},
    	{
    		title : 'Settings',
    		html : '<h2>Settings</h2>',
    		iconCls : 'settings',
    		cls : 'card card4'
    	}]
    });
    This is index.php, I include all neccessary files.

    Code:
    <!doctype html><html>
    	<head>
     		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    		<title>TestApp </title>
    		<link rel="stylesheet" href="../library/sencha-touch-2.0.1.1/resources/css/sencha-touch.css" type="text/css">
    		<script type="text/javascript" src="../library/sencha-touch-2.0.1.1/sencha-touch-all-debug.js"></script>
    		<link rel="stylesheet" href="../resource/css/index.css" type="text/css">
    		<link rel="stylesheet" href="../resource/css/sink.css" type="text/css">
    		<script type="text/javascript" src="js/index.js?v=0.1"></script><!-- this is the js code up there -->
    	</head>
    	<body></body>
    </html>
    Thanks..

  2. You should only create components after the onReady or launch method has fired. You are creating components before onReady is fired, move it within the onReady and it will work

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Answers
    3542
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You should only create components after the onReady or launch method has fired. You are creating components before onReady is fired, move it within the onReady and it will work
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread