Results 1 to 2 of 2

Thread: Can't click anywhere..

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    7
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

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