Results 1 to 2 of 2

Thread: how to make a login with a cross-domain request?

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

    Default Unanswered: how to make a login with a cross-domain request?

    Hi, I am trying to make a login for my app, and i do not understand the poor documentation, i need help...
    can somebody help me?, give me and example or something please!!... thanks..
    this is my code...
    View
    Code:
    Ext.define('Scanner.view.Main', {    extend: 'Ext.Container',
    
    
        requires: [
            'Ext.TitleBar'
        ],
    
    
        config: {
            ui: 'dark',
            layout: {
                type: 'vbox'
            },
            scrollable: false,
            items: [
                {
                    xtype: 'titlebar',
                    docked: 'top',
                    scrollable: false,
                    title: 'Scanner'
                },
                {
                    xtype: 'fieldset',
                    id: 'login',
                    ui: 'dark',
                    scrollable: false,
                    instructions: 'Ingresa los datos',
                    title: '<center>Login</center>',
                    layout: {
                        align: 'center',
                        pack: 'center',
                        type: 'vbox'
                    },
                    items: [
                        {
                            xtype: 'textfield',
                            id: 'usuario',
                            label: 'Cdigo Mensajero:',
                            maxLength: 15,
                            placeHolder: 'A2S3D4'
                        },
                        {
                            xtype: 'passwordfield',
                            flex: 1,
                            id: 'password',
                            label: 'Clave Mensajero:',
                            name: '',
                            maxLength: 15,
                            placeHolder: '******'
                        },
                        {
                            xtype: 'button',
                            id: 'sentButton',
                            ui: 'confirm-round',
                            text: 'Acceso'
                        }
                    ]
                }
            ]
        }
    
    
    });
    Controller
    Code:
    Ext.define('Scanner.controller.Controller', {    extend: 'Ext.app.Controller',
    
    
        requires: [
            'Ext.MessageBox'
        ],
    
    
        config: {
            refs: {
                sentButton: '#sentButton',
                usuario: '#usuario',
                password: '#password'
            },
    
    
            control: {
                "sentButton": {
                    tap: 'sendParametters'
                }
            }
        },
    
    
        sendParametters: function(button, e, options) {
            if(this.getUsuario().getValue() === "" || this.getPassword().getValue() === ""){
                Ext.Msg.alert('Informacin Usuario', 'Falta Informacin Requerida', Ext.emptyFn);
            }
    //I do not what to do here... here is where i guess that i should to send the parameters but i do not how
    //can somebody help me?
    
    
    
    
        }
    
    
    });
    Store
    Code:
    Ext.define('Scanner.store.MyJsonPStore', {    extend: 'Ext.data.Store',
    
    
        requires: [
            'Scanner.model.MyModel'
        ],
    
    
        config: {
            model: 'Scanner.model.MyModel',
            storeId: 'MyJsonPStore',
            proxy: {
                type: 'jsonp',
                url: 'http://sicom.linux-si.com/cgi-bin/webapps/sicom/scanner.py',
                reader: {
                    type: 'json'
                },
                writer: {
                    type: 'json'
                }
            }
        }
    });
    Model
    Code:
    Ext.define('Scanner.model.MyModel', {    extend: 'Ext.data.Model',
    
    
        config: {
            fields: [
                {
                    name: 'messenger_code',
                    type: 'string'
                },
                {
                    name: 'password',
                    type: 'string'
                },
                {
                    name: 'action',
                    defaultValue: 'LOGIN',
                    type: 'string'
                }
            ]
        }
    });

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,318
    Answers
    3883
    Vote Rating
    1291
      0  

    Default

    Why are the docs poor because of this question? I don't get that comment from you.

    Does your server support CORS or JsonP?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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.

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
  •