1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    1
    Vote Rating
    0
    alexunocuatro is on a distinguished road

      0  

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

    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: 'Còdigo 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('Informaciòn Usuario', 'Falta Informaciòn 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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,085
    Vote Rating
    453
    Answers
    3153
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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