1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    104
    Answers
    4
    Vote Rating
    0
    izak18 is on a distinguished road

      0  

    Default Unanswered: ComboBox Problem

    Unanswered: ComboBox Problem


    Hi everybody, I'm working at my work in a project that I have to make a application and I have a problem when I have to populate a combobox, this is my code:

    HTML
    Code:
    <!doctype html><html>
    <head>
     <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Crystalis Consulting</title>
     <!-- CSS -->
    <link rel="stylesheet" href="resources/css/sencha-touch.css" type="text/css">
    <link rel="stylesheet" href="resources/css/style.css" type="text/css">
    
    
    <!-- LIB -->
    <script type="text/javascript" src="resources/lib/sencha-touch.js"></script>
     <!-- APP -->
    <script type="text/javascript" src="src/models/crearDocModel.js"></script>
     <script type="text/javascript" src="src/stores/crearDocStore.js"></script>
     <script type="text/javascript" src="src/views/crearDocViews/crearDocView.js"></script>
    <script type="text/javascript" src="src/crearDoc.js"></script>
     </head>
    <body>
    </body>
    </html>
    crearDoc.js
    Code:
    Ext.setup({    
        onReady: function() 
        {
    		crearDocView = new crearDocView();
        }
    });
    crearDocView
    Code:
    var buttonVolver = [{	ui: 'confirm',
    	text: 'Volver',
    	handler: function()
    		{
    			window.open("menu.html","_self");
    		}
    	},
    	{
    		xtype: 'spacer'
    	},
    	{
    	ui: 'confirm',
    	text: 'Crear',
    	handler: function()
    		{
    			window.open("crearDoc2.html","_self");
    		}
    	}
    ]
    
    
    var dockedItems = [{
    	xtype: 'toolbar',
    	title: 'Elegir Documento',
    	dock: 'top',
    	ui: 'dark',
    	items: buttonVolver
    }]
    
    
    var lblRef = [{
    	xtype: 'fieldset',
    	defaults: 
    		{
    			labelAlign: 'left',
    			labelWidth: '30%'
    		},
    	items: [
    	{
    		xtype: 'textfield',
    		label: 'Referencia',
    		useClearIcon: true
    	}]
    }]
    
    
    var combo = {
    	xtype : 'combo',
    	fieldLabel : 'Clase de Documento:',
    	forceSelection : true, // 5
    	displayField : 'empresa', // 6
    	valueField : 'ordenCompra', // 7
    	hiddenName : 'customerId', // 8
    	loadingText : 'Querying....', // 9
    	minChars : 1, // 10
    	triggerAction : 'name', // 11
    	store : crearDocStore
    };
    
    
    crearDocView = Ext.extend(Ext.Panel, 
    {
    	fullscreen: true,
    		
    	initComponent: function() 
    	{
    		this.crearDocPanel = new Ext.Panel(
            {
    			dockedItems: dockedItems,
    			
    			items: combo,
    			renderTo: Ext.getBody()
    			
    		});		
            
            this.items = this.crearDocPanel;
            crearDocView.superclass.initComponent.call(this);
    	}
    });
    
    
    Ext.reg('crearDocView', crearDocView);
    crearDocModel.js
    Code:
    Ext.regModel('crearDocModel', {    fields: [
            {name: 'ordenCompra', type: 'string'},
            {name: 'empresa',  type: 'string'},
            {name: 'orgCompras', type: 'string'},
            {name: 'condPago',  type: 'string'},
            {name: 'claseDoc',  type: 'string'},
            {name: 'grpCompras',  type: 'string'},
            {name: 'moneda',  type: 'string'},
            {name: 'tc',  type: 'string'},
            {name: 'codProveedor',  type: 'string'},
            {name: 'proveedor',  type: 'string'},
            {name: 'fecha',  type: 'string'},
            {name: 'totalNeto',  type: 'string'},
            {name: 'totalBruto',  type: 'string'},
            {name: 'grpLiberacion',  type: 'string'},
            {name: 'estLiberacion',  type: 'string'},
            {name: 'indLiberacion',  type: 'string'},
            {name: 'codLiberacion',  type: 'string'}
        ]
    });
    crearDocStore.js
    Code:
    var crearDocStore = new Ext.data.Store ({
    	model: 'crearDocModel',
    	proxy:
    	{
    		type: 'scripttag',
    		url: 'http://localhost/decor2/src/stores/prueba.do',
    		reader:
    		{
    			type: 'json',
    			root: 'root'
    		}
    	},
    	autoLoad: true
    });
    Please help me
    Thanks in advance.
    Last edited by mitchellsimoens; 27 Mar 2012 at 4:49 AM. Reason: change [QUOTE] to [CODE]

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,207
    Answers
    3517
    Vote Rating
    858
    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 are using a lot of things that are not valid to Sencha Touch 2.
    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.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    104
    Answers
    4
    Vote Rating
    0
    izak18 is on a distinguished road

      0  

    Default


    Wow, I did not know that.


    Could you please tell me how I can reorganize my project and what part is not valid to Sencha Touch 2? Is very important to me.


    Thank you so much.

Thread Participants: 1