1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    2
    Vote Rating
    0
    akshaydch11 is on a distinguished road

      0  

    Default ExtJS mvc loading view after successfully logged in

    ExtJS mvc loading view after successfully logged in


    I am trying to develop an application in ExtJS using MVC. The aim of design application is something: 1. Create a log in page for authentication 2. after successful log in I have to show 3 grids in single page. These 3 grids have different stores and models.
    I am able to design login page, but I am facing problem in going fwd to next view after logged in.

    =====> controller/Login.js

    Code:
    Ext.define('MyApp.controller.Login', {    extend: 'Ext.app.Controller',views: ['Login'],    refs: [        {            ref: 'viewportmain',            selector: 'viewportmain'        }      ],    init: function () {        this.control({        'viewport > panel': {                render: this.onPanelRendered            },            'button[action=submitLogin]': {                click: this.submitLoginForm            }        });    },onPanelRendered: function() {        console.log('The panel was rendered');    },    submitLoginForm: function (button) {///// DO NOT BOTHER ABOUT LOGIN AUTHENTICATION PROCESS        console.log('submitLoginForm function');       // var view = Ext.create('MyApp.view.Order', {});        var OrderController = this.getController('MyApp.controller.Order');        OrderController.showNext(button);// I HAVE TRIED CERTAIN WAYS IN COMMENTED SECTION       // var view1 = OrderController.getOrderView();       // var form = button.up('form').getForm();        //var view1 = this.getOrder();        var form = button.up('form').getForm();        form.owner.up('viewport').getLayout().next();        //this.getViewportmain();    console.log('The ');    }});
    ======> controller/Order.js

    Code:
    Ext.define('MyApp.controller.Order', {    extend: 'Ext.app.Controller',    alias: 'controller.order',    stores:['Order'],    models:['Order'],    views: ['Order'],    init: function () {        this.getOrderStore().load();    },    showNext: function(button) {        var view = Ext.create('MyApp.view.Order');        view.show();    } });
    


    =======> view/viewport.js

    [CODE]
    Ext.define('MyApp.view.Viewport', { extend: 'Ext.container.Viewport', alias: 'widget.viewportmain', requires: [ 'MyApp.view.Login', 'MyApp.view.Order', 'MyApp.view.DisplayGrids' ], layout: 'fit', items: [{ xtype: 'login' }, { xtype: 'form', layout: 'fit', title: 'new form' }]});[/CODE]

    =======> app.js
    Code:
    Ext.Loader.setConfig({enabled:true});Ext.application({    name: 'MyApp',    appFolder: 'App',    models:['Order'],    stores:['Order'],   controllers: [        'Login'//, 'Order'    ],    autoCreateViewport: true});


    I am trying to make these grids combine in the commoon panel ========> view/DispalyGrid.js
    Code:
    Ext.define('MyApp.view.DisplayGrids' ,{    extend: 'Ext.form.Panel',    alias: 'widget.displaygrids',    layout: 'fit',    items: [{      xtype: 'order'    }]});


    I have tried to call Order from DisplayGrid which eventually gives errors so I tried to go directly with the view/Order.
    Please guide me this I was trying this thing from long time and I am doing something really wrong. I have tried this but every time it gave me error

    Code:
    Cannot read property 'buffered' of undefined
    Thanks in advance.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,801
    Vote Rating
    834
    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


    So where are you? What do you have working?
    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
    Oct 2012
    Posts
    2
    Vote Rating
    0
    akshaydch11 is on a distinguished road

      0  

    Default


    @mitchellsimoens I am able to redirect to next page having 3 grids but still data from store does not get loaded in the grids.

    Below is short summary what I have done.

    view/Viewport.js ---> [ {xtype: login},
    {xtype: displaygrid}]

    view/Displaygrids.js --->
    [ {xtype: firstgrid},
    {xtype: secondgrid},
    {xtype: lastgrid}]
    Constroller/Login.js -->
    this is code which redirects to next page...
    onButtonClick{
    this.getViewportmain().getLayout().next();
    }

    -aksdch11

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi