1. #1
    Sencha User
    Join Date
    Oct 2010
    Location
    Brazil - MG, Belo Horizonte
    Posts
    62
    Answers
    4
    Vote Rating
    0
    wallynm is on a distinguished road

      0  

    Default Unanswered: System migration

    Unanswered: System migration


    Hello guys, currently i am starting to work with extjs 4 and i'm needing some help to migrate an system that i had build on jQuery, with several plugins. On this system, i have an top menu, which redirect the user to the desired page when an item is clicked... I did some tutorials with extjs 4 , and i saw that on the start you define an js called app.js which has the default controller of your system.
    Until here, all fine!


    But i need to put an menu on the top of the system, i will try to find an way to do it. The reason of the thead is that i don't know how to make new loads of new table grids on the system, before user select an item on the menu. On the old system, when user click on an menu, i just need to reload all the page, with the desired HTML, but i don't know the best way to make it on extjs.


    I was wondering if i would destroy all the panels, them load a new model, a new controller with some ext function?
    Or maybe it isn't so hard, i just need to reload the HTML with the new controller that i wanna to load (and the defined models, views and etc... I would be realy happy to know that this is the correct option... )
    And if it is, HOW can i made it? I didn't saw any example working with many grids on an system (on diferent pages).


    I whish that everyone could understand it... Also,i tried to search on the forum and on the web about this, but i didn't found anything, if someone has some links or maybe, could explain me how to do it, i will bre really glad!


    Thanks to everyone!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,015
    Answers
    3491
    Vote Rating
    847
    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


    To do a menu look at this example: http://docs.sencha.com/ext-js/4-0/#!...enu/menus.html

    To add a grid to another panel, say you have a Panel like so:

    Code:
    var panel = Ext.create('Ext.panel.Panel', {
        renderTo : Ext.getBody,
        width  : 400,
        height : 400,
        layout : 'fit',
        title : 'Test Panel'
    });
    You can then add a grid like so:

    Code:
    panel.removeAll(); //removes all children of panel
    panel.add({
        xtype : 'gridpanel',
        column : [....],
        store    : someStore
    });
    To create a grid, we have lots and lots of examples 25 examples) here: http://docs.sencha.com/ext-js/4-0/#!/example
    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 2010
    Location
    Brazil - MG, Belo Horizonte
    Posts
    62
    Answers
    4
    Vote Rating
    0
    wallynm is on a distinguished road

      0  

    Default


    So, every time the user click on an item on the top menu, i jsut need to delete all the children elements, them load all new views, models, etc?

    But, how can i work with the MCV structure like this way? Controllers should load all the views (grids on the panel), how i would load the controller?

  4. #4
    Sencha User
    Join Date
    Oct 2010
    Location
    Brazil - MG, Belo Horizonte
    Posts
    62
    Answers
    4
    Vote Rating
    0
    wallynm is on a distinguished road

      0  

    Talking


    We don't have any example on sencha docs teaching how to work with multiple controllers... Because of it, it is a quite hard to understand how to work with the new MVC structure... Searching on the web, and reading many theads, i finally had found what i was looking for!

    http://www.sencha.com/forum/showthread.php?132795-Dynamically-loading-MVC-controller&p=605522&viewfull=1#post605522

    On this Thead, we have an example to download where Dynamic loader of controllers are enabled (ext has it with this.getController function), and it is what i was looking for! With it, i can handdle page requisitions by the user needs...

    Thanks!

Thread Participants: 1

Tags for this Thread